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. ioncoder
    I
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 8
    • Best 0
    • Groups 0

    ioncoder

    @ioncoder

    0
    Reputation
    9
    Profile views
    8
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    ioncoder Follow

    Latest posts made by ioncoder

    • RE: How to access Vuex from Axios boot files

      @s-molinari @metalsadman Thank you, Yep, That solved it. I was coding from 7am till 1am yesterday so I will give myself a break (this time), still feel like a bit of an idiot though.

      Thanks for your help.
      Simon

      posted in Help
      I
      ioncoder
    • RE: How to access Vuex from Axios boot files

      @metalsadman Thank you. You know I always use that when using vanilla Vue, I don’t know why I didn’t already try that. I think it might be because Quasar does so much for you (which is great), but you start to stop thinking for yourself sometimes.

      I will give it a try
      Simon

      posted in Help
      I
      ioncoder
    • RE: How to access Vuex from Axios boot files

      @s-molinari Thanks Scott. I have already tried that approach. I can see the modules when I inject store, but I can not access any of the variables within State or any of the methods in actions or mutations. For example in the user module I have

      state: {
         user: { firstname: 'John', lastname: 'Smith', email: 'jsmith@example.com' },
        token: { token: 'xxxxx', refresh_token: 'xxxxxxxx' }
      }
      

      Through injected state in axios.js I can’t get below the base variables

      user: { obj:..., proto: ....},
      token: {obj: ...., proto: ....)
      

      For now, I have worked around it by writing my token to LocalStorage, which I can access from axios.js, but I want to get this fixed, so everything is accessed through the store.

      Simon

      posted in Help
      I
      ioncoder
    • How to access Vuex from Axios boot files

      I store my JWT tokens in vuex module (user) and I have a axios request interceptor that I use to populate the Brarer token in the request head.

      In vanilla Vue, I would simply import the store and then access my module state

      import store from '../store/index'
      var token = store.state.user.token
      

      When I try to do this from axios.js in Quasar it does not work. Can anybody help.

      A point to note, mapState in Vue files works just fine, so I’m 99.9% sure vuex is configured correctly.

      posted in Help
      I
      ioncoder
    • How to Add / Edit the electron system menu (File, Edit, View etc)

      I am using Quasar to write a desktop app for Mac, Windows, and Linux.

      I want to make use of the window menus File, Edit, View, Window, and Help. I also want to add some other menus dynamically based on the current page. I can’t find any information in the docs or on google of how to manage those menus in Quasar. There is information in the Electron docs, but I’m not sure where I should implement that in the Quasar framework.

      posted in Help
      I
      ioncoder
    • RE: vuex mutations not working as expected

      @metalsadman That was the first place I went and I am not new to VueJS. Below is an excerpt from that page (The one you reference), please can you explain what is different between this and what I am doing?

      const store = new Vuex.Store({
        state: {
          count: 1
        },
        mutations: {
          increment (state) {
            // mutate state
            state.count++
          }
        }
      })
      
      posted in Help
      I
      ioncoder
    • vuex mutations not working as expected

      This could of course be bug with VueX but I thought I would check if the issue is specific to Quasar first.

      In my vuex store file the following gives the error Error: [vuex] do not mutate vuex store state outside mutation handlers.

      vxUserSetEmail (state, email) {
         state.email = email
      }
      

      however this works just fine.

      vxUserSetEmail (state, email) {
         this.email = email
      }
      

      Can anyone explain if I am doing something wrong, or is this a bug that needs to be reported and if so, to who?

      posted in Help
      I
      ioncoder