Category "vuex"

Props typing in Vue.js 3 with TypeScript

I'm trying to type hint my props in a Vue 3 component, with composition API. So, I'm doing this: <script lang="ts"> import FlashInterface from '@/interfac

props keep showing as $attrs in VUE DEV TOOLS

enter image description hereenter image description here My props keep showing as $attrs in VUE DEV TOOLS I have tried disabling attrs using inheritAttrs: false

Vue stored valued through props not being reactive

So I pass value using [props] and stored it in child component's data. However, when passing [props] value changes from parent, it's not updating in child compo

Vue stored valued through props not being reactive

So I pass value using [props] and stored it in child component's data. However, when passing [props] value changes from parent, it's not updating in child compo

Vue version not in any npm list

I have sometime to code with vue and node. I returned to my windows 10 system and using git bash I have node in my windows system : $ node -v v12.14.1 Then I d

Returning data from a Vuex action

Can I return data from a Vuex action or do I need to update the store? I've got an action defined but it returns no data: getData() { return { "a" : 1, "b"

How to handle permissions for route from database?

In Vue, when I want to restrict some pages for some users, in router I define a permission in meta, like this: routes: [ { path: 'transport',

How to mock $nuxt object in vue-test-utils and jest

I am using vue-test-utils and jest in order to test my code. My test run without any problem except if it pass through the code below $nuxt.$store.commit("devi

Passing value to store getters Vue.js

I'm trying to pass ID as parameter to store getter, but when i console that id I get undefined. Can someone help me with this: Here is my code: This is how i

Vue - How to access component's property from Vuex

In my app I use Vuex to perform async tasks. In this case I use it to log user to my app. When user is logged and axios.then() is being performed I want to info

How to pass an argument to Pinia store?

I'm making a session API call in main.js and using values from the response as the initial value for my root store. In vuex it's handled this like, DataService.

Change another module state from one module in Vuex

I have two modules in my vuex store. var store = new Vuex.Store({ modules: { loading: loading posts: posts } }); In the module loading

How to access Vuex module getters and mutations?

I'm trying to switch to using Vuex instead of my homegrown store object, and I must say I'm not finding the docs as clear as elsewhere in the Vue.js world. Let'

Returning Promises from Vuex actions

I recently started migrating things from jQ to a more structured framework being VueJS, and I love it! Conceptually, Vuex has been a bit of a paradigm shift fo

Reevaluate Nuxt.js middleware without a route change

I'm wondering if it's possible to essentially "reevaluate" the middleware conditions without actually changing the current route. The middleware's purpose is to

How to use vue router and vuex inside custom element from root?

I have project with nested custom elements. Now I need to vuex & vue router. How I can use this packages from root custom element and then use in all child

How can i make sure a vuex action has finished before the page loads

I have 2 issues where i pull data from an api and use it. However, the page loads before the api request has completed. My first problem is in the router. I hav

Vuex - Do not mutate vuex store state outside mutation handlers

Why do I get this error: Error [vuex] Do not mutate vuex store state outside mutation handlers. What does it mean? It happens when I try to type in the edit i

How to access async store data in vue-router for usage in beforeEnter hook?

How is it possible to access store data in beforeEnter which is retrieved asynchronously via the store action? import store from './vuex/store'; store.dispatc

How do I set initial state in Vuex 2?

I am using Vue.js 2.0 and Vuex 2.0 for a small app. I am initializing the store in the 'created' life-cycle hook on the root Vue instance by calling an action t