Passing props dynamically to dynamic component in VueJS

后端 未结 5 1403
南笙
南笙 2020-12-02 05:44

I\'ve a dynamic view:

with an associated Vue ins

5条回答
  •  误落风尘
    2020-12-02 06:21

    If you have imported you code through require

    var patientDetailsEdit = require('../patient-profile/patient-profile-personal-details-edit')
    and initalize the data instance as below

    data: function () {
                return {
                    currentView: patientDetailsEdit,
                }

    you can also reference the component through the name property if you r component has it assigned

    currentProperties: function() {
                    if (this.currentView.name === 'Personal-Details-Edit') {
                        return { mode: 'create' }
                    }
                }

提交回复
热议问题