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

    vuex getters actions

    Framework
    getters quasar vuex vuex
    5
    6
    2918
    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.
    • N
      nazemi-sfa last edited by

      please give a sample code for whole vuex store on quasar .
      this.$store.getters.nameOfStore.nameOfGetters does not work.
      and in quasar.dev there is only this :
      https://quasar.dev/quasar-cli/cli-documentation/vuex-store#Adding-a-Vuex-Module.

      1 Reply Last reply Reply Quote 1
      • M
        mvelikoff last edited by

        try this.$store.getters[‘MODULE_NAMESPACE/GETTER_NAME’].
        example: this.$store.getters[‘auth/getUsername’]

        1 Reply Last reply Reply Quote 1
        • dobbel
          dobbel last edited by

          This is better:

          In your component:

          computed: {
          …mapGetters(‘MODULE_NAMESPACE’, [‘GETTER_NAME’])
          }

          then you can use the store getter as a computed property in your component.

          1 Reply Last reply Reply Quote 1
          • king_of_leon
            king_of_leon last edited by king_of_leon

            it little confusing on docs , a example would really help

            metalsadman 1 Reply Last reply Reply Quote 1
            • metalsadman
              metalsadman @king_of_leon last edited by

              @king_of_leon you should read vuex docs too.

              1 Reply Last reply Reply Quote 1
              • king_of_leon
                king_of_leon last edited by

                ok thanks

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