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
    1. Home
    2. Tags
    3. vuex
    Log in to post
    • O

      How can I call Vuex store getters in routes.js file
      Help • getters vue-router vuex • • oussama-he

      2
      0
      Votes
      2
      Posts
      1382
      Views

      metalsadman

      @oussama-he make your router/routes.js a function that accepts a store parameter from your router/index.js. example:

      // src/router/routes.js ... const routes = (store) => [ ... beforeEnter: (to, from, next) => { if (store.getters.isAuthenticated) { console.log('authenticated user'); next('timeline') } else next() } ... ] export default (store) => routes (store) // src/router/index.js import routes from './routes.js' export default function ({ store }) { // <-- accepts store as parameter const Router = new VueRouter({ scrollBehavior: () => ({ x: 0, y: 0 }), routes: routes(store), // <--- pass the store context to your routes.js ...
    • forevereffort

      At Quasar framework, how to add the chokidar.watch value to Vuex Store?
      Framework • typescript vue quasar vuex • • forevereffort

      2
      0
      Votes
      2
      Posts
      203
      Views

      dobbel

      @forevereffort

      You’re changing state outside of a mutation. Where that happens is unclear from the warning logs. You’ll have to investigate that yourself more.

      maybe:

      state.fileWatcher.close()
    • forevereffort

      Fix tslint issue on Quasar component (getting the value from the Vuex Store)
      Framework • typescript vue quasar vuex • • forevereffort

      6
      0
      Votes
      6
      Posts
      309
      Views

      dobbel

      @forevereffort

      Sure if it works and you have types now.

    • T

      Cordova Plugin not working in Vuex files
      Help • cordova-plugin import vuex • • tc

      14
      0
      Votes
      14
      Posts
      1111
      Views

      R

      @tc Hi,
      Just like you are using storage plugin as I’m using advance HTTP plugin.
      Cordova loads plugins after when device is ready. If you try to use plugin directly when app is booting then these plugins would not be available. So I used “deviceready” event to access http plugin and you can use the same event.

    • M

      Unable to use this.$axios in Vuex: TS2339: Property '$axios' does not exist on type 'Store '.
      Framework • axios typescript vuex • • Maxiride

      11
      0
      Votes
      11
      Posts
      2340
      Views

      Hawkeye64

      @ytsejam

      I think it is used as “this._vm.axios”, but did not work for me I have found this boot solution.

      For one thing, you would need to access it as: this._vm.$axios because you put a $ in front on the prototype definition
      Second, I don’t know how you are writing your functions but the this will be inforrect if you used fat arrow (=>) – they need to be functions for this to be referencing the store.

    • R

      Where to initialize Vuex store at app start up?
      Help • acessing store init vuex • • rhscjohn

      5
      0
      Votes
      5
      Posts
      2883
      Views

      metalsadman

      @dobbel yes because it’s a function, in the boot is different, the store instance is passed as a parameter it’s the same store instance in your src/store/index.js, you’ll get more context if you check .quasar/client-entry.js file (if I’m not wrong), to see how those are initialized, you’ll also see there why $router instance is accessible in your stores via this.$router (if you are using function instead of arrows). I suggest you check that folder out in your project.

    • T

      TypeScript error when using this.$router in actions.ts
      Framework • firebase typescript vue-router vuex • • tempted2use

      3
      0
      Votes
      3
      Posts
      1486
      Views

      I

      Hey! Im having the same problem, but I would like to know why I cannot just import Router inside actions.ts and use it as I usually did on Javascript files.

      I know that it is something related to the router Quasar wrapper and I am getting really stuck on understanding why is this happening.

      Thank you.

    • I

      vuex mutations not working as expected
      Help • mutations vuex • • ioncoder

      6
      0
      Votes
      6
      Posts
      645
      Views

      dobbel

      @BillD http://shzhangji.com/blog/2018/04/17/form-handling-in-vuex-strict-mode/

      I think the ‘Computed Property’ way with get/set is the best approach. So you can still use v-model.

    • J

      spread operator in vuex not working with any presets
      Help • babel presets quasar 1.4 vuex • • jorgv

      3
      0
      Votes
      3
      Posts
      329
      Views

      J

      Hi @metalsadman thanks for answering,

      After you mentioned if I had vuex in the project I search more than I had it installed but I was importing the function wrong

      import { ...mapGetters } from 'vuex';

      I fixt the error by importing it right.

      thanks again and sorry

    • N

      vuex getters actions
      Framework • getters quasar vuex vuex • • nazemi-sfa

      6
      1
      Votes
      6
      Posts
      2847
      Views

      king_of_leon

      ok thanks

    • D

      Loading firebase user identity before everything else?
      Help • auth firebase vuex • • darshie

      5
      0
      Votes
      5
      Posts
      1350
      Views

      T

      @darshie the function is called slighly different in 0.17 my code is for v1 forgot to say

      LocalStorage.get.item(key)

      https://quasar-framework.org/components/web-storage.html#Getting-Started

    • R

      Access $i18n in vuex action
      Framework • i18n vuex • • reath

      4
      0
      Votes
      4
      Posts
      1531
      Views

      s.molinari

      Well, Quasar’s i18n is “native” to its components, meaning, the languages available and the i18n system is only for Quasar’s components. Needing the i18n object outside of the components is basically not necessary. You set it once in, say, a layout component and you are good to go for all further components, as the docs explain.

      Scott

    • S

      Solved: Vuex actions this.$
      Help • vuex • • silentcoast

      3
      2
      Votes
      3
      Posts
      1719
      Views

      benoitranque

      Couple ways to go about it. One is to add a named export to your plugins and import that in stores. Another is to pass the vue instance to the store when dispatching actions

      Edit:
      You can access the vue instance from the store using this._vm

    • D

      q-uploader and vuex?
      Help • images q-uploader vuex • • Diferno

      2
      0
      Votes
      2
      Posts
      1256
      Views

      S

      @Diferno said in q-uploader and vuex?:

      n my Vuex store I

      hi, Diferno can you plz share your code how you configure additionalFields in q-uploader. and how you receive that field from server side.

      thanks.

    • G

      Some components not really Vuex friendly
      Framework • modal vuex • • genyded

      6
      2
      Votes
      6
      Posts
      2235
      Views

      G

      https://github.com/quasarframework/quasar/issues/479

    • Dobromir

      Proper way of using Quasar with Vuex
      Help • vuex • • Dobromir

      5
      0
      Votes
      5
      Posts
      10254
      Views

      D

      And what about “tracking” the modal state itself? (opened/closed) and their acctions? (open, cancel, accept, etc.)