No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Problem dynamic import component with `this.$q.dialog(...)`

    Help
    3
    5
    976
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      theara last edited by

      I base on Meteor + Quasar.
      I would like to use dynamic 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"
      
      metalsadman 1 Reply Last reply Reply Quote 1
      • metalsadman
        metalsadman @theara last edited by metalsadman

        @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()})}.

        1 Reply Last reply Reply Quote 0
        • T
          theara last edited by

          @metalsadman thanks for your reply.
          I tried this, but still get this error.

          1 Reply Last reply Reply Quote 0
          • T
            theara last edited by

            Have anyone help me?

            1 Reply Last reply Reply Quote 0
            • D
              darkshifty last edited by

              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

              1 Reply Last reply Reply Quote 0
              • First post
                Last post