Navigation

    Quasar Framework

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

    Accessing VUEX Store inside a Dialog with custom Component

    Framework
    acessing store custom dialog
    3
    3
    176
    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.
    • R
      ReDeLe last edited by

      Quasar V1.05
      Hello,
      i am using the Dialog plugin with an custom Component to show the Dialog in different pages.

      export function showResultsDialog (parentRoot) {
      return new Promise(function (resolve, reject) {
      Dialog.create({
      component: RlShowResultsDialog,
      root: parentRoot
      }).onOk(() => {
      resolve(‘ok’)
      }).onCancel(() => {
      resolve(‘cancel’)
      })
      })
      }

      This function is called inside a page like this:
      showResultsDialog(this.$root)

      Everything seems to work, but inside the custom Component i can not access the VUEX Store because
      this.$store is undefined.

      Where is my mistake ? Has any body solved this problem? Thank you!

      1 Reply Last reply Reply Quote 0
      • bestog
        bestog last edited by

        I have the same problem. Can someone help?

        1 Reply Last reply Reply Quote 0
        • metalsadman
          metalsadman last edited by metalsadman

          @ReDeLe can you try to create your dialog inside a boot file, see if it works ie.

          // boot/customdialog.js
          ... // your dialog impl
          export default ({Vue, app}) => {
            Vue.prototype.$cDialog = showResultsDialog(app)
          ...
          

          Btw this guide https://quasar.dev/quasar-plugins/dialog#Invoking-custom-component
          Is called inside a vue file, so i think it should be called with that signature.

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