Problem dynamic import component with `this.$q.dialog(...)`
-
I base on
Meteor + Quasar
.
I would like to usedynamic import comment on Dialog()
methods: { showDialog() { let DialogForm = () => import('../components/DialogForm.vue') this.$q .dialog({ component: DialogForm, .... }
Get error
[Vue warn]: Error in mounted hook: "TypeError: Cannot read property 'show' of undefined"
-
@theara while you didnt show how you called it at your mounted, try to wrap the method call inside a nextTick ie.
mounted(){ this.$nextTick(()=>{ this.showDialog()})}
. -
@metalsadman thanks for your reply.
I tried this, but still get this error. -
Have anyone help me?
-
I had this issue too but it eventually it seemed that there was something wrong deep in a computed vuex store on the dialog. I had a typo within a state that I used and the dialog failed to create with all sorts of errors like Cannot read property ‘show’ or ‘hide’ of undefined