Questions tagged [vuex]

Vuex is a Flux-inspired Application Architecture for Vue.js.

0
votes
1answer
15 views

After I add vuex persist plugin I cannot get store in router

After I add vuex persist plugin I cannot get store in router. const vuexPersist = new VuexPersist({ key: "vuex", storage: localStorage }); const store = new Vuex.Store({ state: {}, ...
0
votes
2answers
26 views

Set parameter in FormData for dynamic fields (Javascript)

I am getting an issue on setting up the form data for dynamic fields included input[type="file"]. In my word, Dynamic fields mean generating the fields with the loop of an array. I tried the for ...
1
vote
1answer
25 views

How to handle an image upload before creating the entry for the account in the database?

I'm building a single page application. On the client side I'm using Nuxt.js (which includes Vue.js and Vuex). To send and receive data to the server I use axios. The API was built with the Django ...
1
vote
0answers
25 views

axios + Vuex - avoid having to catch a reject Promise twice?

I'm using vuex alongside Vue.js + Django. It's my first foray into reactive front-end development. I'm using a Django REST setup, and wanted to emulate a server error or connection problem, and see ...
0
votes
1answer
15 views

How in vuex.js to save in the “store” the text entered in the input? Where did i make a mistake?

I suffer the third day. Help me please. How in vuex.js save the text entered into the input in the "store", and then add it to the Value of the same input itself. I'm trying to do it like this but ...
0
votes
1answer
21 views

Vuex update state by using store actions

I have two functions in my store, one that gets data by calling API and one that toggles change on cell "approved". Everything working fine, except that when I toggle this change it happens in ...
6
votes
1answer
56 views

How to sync states between backend and frontend using vuex and vue-router?

I am developing a single-page-application using vue-cli3 and npm. The problem: Populating a basic integer value (stored in a vuex state) named counter which was incremented/decremented in the backend ...
0
votes
1answer
26 views

Error performing a CRUD operation using Vuex in vuejs

I have been trying to add a new note but whenever I try to add it the console returns TypeError: _vm.addNote is not a function and Property or method "addNote" is not defined on the instance ...
0
votes
1answer
21 views

blank the field on Submit (vee-validate vue)

I'm creating a form in Vue having validation of Vee-validate. I want to make field blank on submit. But it is giving an error when I make the field blank on submit. Can someone please help me to ...
0
votes
1answer
29 views

How do I monitor a deep value in object while using vuex

Please check this example. https://codepen.io/suedar/pen/XGyGOj After I click the li, the div is required to display which is not. I know it is because Reactivity in Depth. I want to know how can I ...
-1
votes
1answer
72 views

Vuex - Update entire object inside array

Inside my mutation I want to update an entire object every 10 seconds: This is my mutation: UPDATE_MAILING(state, mailing) { let index = _.findIndex(state.mailings, {id: mailing.id}); state....
0
votes
0answers
36 views

VUEX: Vuetify Expansion panel slot doesn't update after add an item

I have a data table made using Vuetify. When a user clicks in an item (the row), it shows an expansion panel with updates about the item where users can add new updates. The expansion panel have a ...
0
votes
0answers
19 views

Uncaught TypeError “vuex__WEBPACK_IMPORTED_MODULE_1__.default.store is not a constructor”

In Vue.js, I am trying to carry my data into store.js file using vuex, but I get error "store.js?07a4:6 Uncaught TypeError: vuex__WEBPACK_IMPORTED_MODULE_1__.default.store is not a constructor". My ...
0
votes
1answer
30 views

Need multiple instances of Vuex module for multiple Vue instances

I'm integrating Vue onto a site for forms, which means I have to create several instances of that Vue application if there are multiple forms on the page. All instances share the same Vuex store. I ...
0
votes
1answer
38 views

Where i may put authorization logic in vue.js?

I creating authorization component for firebase. And found many post about how may create authorization service, most part of that post was about create some global const or the very interesting way - ...
1
vote
1answer
27 views

Updating array in vuex not reacting in component

I am trying to push/pop off an array that is in a vuex module. when viewing in vue dev tools the array correctly adds/removes. However the computed property does not update, im expecting a change but ...
1
vote
1answer
16 views

How to access vue/vuex mapActions methods with similar name while has different namespace?

This works just fine. created() { this['shared/getPosts'](); this['posts/getPosts'](); }, methods: { ...mapActions(['shared/getPosts', 'posts/getPosts']), }, But, I was wondering, is there a ...
0
votes
1answer
38 views

Vue.js - Unknown custom element: <router-view>

I'm bit new to Vue.js and I'm trying to implement routing to the application but for some reason I'm facing an issue saying: Unknown custom element: <router-view> - did you register the ...
0
votes
2answers
30 views

V-model populated in a method not updating the DOM

I am newbie in VueJs.(vue 2). I have a problem here. I have a table where I am dynamically populating data like this. <tbody> <tr v-bind:key="queProduct.value" v-for="queProduct in ...
0
votes
1answer
28 views

v-for with filter gives error of property or method not defined

I'm using Vue2 with Vuex. I have a list of posts from https://jsonplaceholder.typicode.com/posts I want to show it in descending order. for that, I created a filter named "desc" in main.js and ...
0
votes
0answers
11 views

Testing production vuex instance in JEST

I have some Vuex modules in my project (for example school, people etc.). Every module has its actions, mutations, state and getters. Each of them I want to test. For example, I have action like below ...
0
votes
1answer
29 views

Lazy loading Vuex module with NuxtJS

Can anyone help me Lazy loading Vuex module? Where am I doing wrong? https://codesandbox.io/s/py197qvxx?fontsize=14 Where am I doing wrong?
0
votes
0answers
17 views

Two way binding Vuex

I know to use vmodel with vuex you use a computed property with a setter and getter, where the getter dispatches an action. How would this work when the property you want to bind with is an array? ...
2
votes
1answer
29 views

Share data between sibling components if data is not already persisted to Vuex?

If I have two sibling components that share the same data and that data is not already persisted to Vuex (e.g. a direct page load to api/v1/calendars/:id, would making a call to that resource within ...
0
votes
1answer
22 views

Vuex: Child component wait for parent component dispatch action

Parent component (Dashboard): <template> <div id="dashboard"> <Header /> <b-container> <div> <b-row> <b-col> <Overview /&...
2
votes
1answer
20 views

Vee validate get previous value after vue set

I want to update v-model value by code and validate that field. So I am using vue.set method for updating value and then call $validator.validate. my code is something like that. Vue.set(model,...
0
votes
0answers
12 views

Laravel X Vuejs X Vuex loading concept

Can anyone tell me what's wrong with my code: //Start Loading load_post(id) { this.$store.dispatch('start_sub_loader'); this.$router.push({ path: '/post/'+ this.hashid(id)}); }, //End ...
1
vote
1answer
22 views

How can I test vuex action which with jest which has an api call inside it?

ASYNC ACTION VUEX : This is async action which will be called from the component, it consists of an function fetchGaragesData that will make an api call to fetch data from server. [ACTION_TYPES....
0
votes
0answers
23 views

Setting firebase.User in vuex results in eternal loop

UPDATE: This error only occurs with vuex strict mode enabled I am building a Vue application with firebase authentication, but the application fails with the following error messages: [Vue warn]: ...
0
votes
2answers
37 views

Why do I get “Avoid mutating a prop directly” when using NumericTextField?

I have created a simple view component in VueJS and I'm getting a pretty common error: void mutating a prop directly since the value will be overwritten whenever the parent component re-renders. ...
0
votes
2answers
25 views

Vuex commit not updating state

I am creating a language flashcard app and am having issues with the state updating when I switch lists. So I see that in my store the mutations are being fired but in my Vuex Dev Tools the state is ...
0
votes
1answer
15 views

Post to given endpoint as multipart file

I've got working backend in Spring Boot with JWT-secured endpoint for modifying avatar of current user. The following request from Insomnia with correct Bearer works fine: But this code ...
0
votes
1answer
20 views

How to manipulate inline SVG from vuex

So, I am creating a customizing tool for cursors with Vuejs and Vuex. Currently, I am stuck in the step where I have to bind a color user is going to click on to the fill of svg cursor. I will try to ...
1
vote
1answer
32 views

Global vuex watchers

I have a Vuex store feeding many Vue components in a somewhat large web app. I would like to be able to watch Vuex states or getters for logging purposes. However, I want to be able to watch them '...
1
vote
1answer
31 views

Vuex Typescript I am getting the error “Member 'someMutation' implicitly has an 'any' type.” in the Component.ts file

I am getting the error: "Member 'someMutation' implicitly has an 'any' type.". This error appears in my Vue Component in Component.ts file for the mutation, received from Vuex store. I have the ...
0
votes
1answer
39 views

Vuex : How to check if an action exists before dispatching it?

I am getting this error : "Unknown local action type..." when I'm dispatching my action, which happens to be in other modules. The action which I'm dispatching does not exist in certain cases. So, I ...
0
votes
1answer
22 views

Vuex not working with different components

I have this structure for a Vue app: App.vue -> Router View(with two child components) App.vue <template> <div id="app" @click="mutateStore(null)"> <router-view @...
0
votes
2answers
63 views

Vue component not updating on state change

<div v-for="(photon, key) in $store.state.notConnected" v-bind:key="key"> <div v-if="!photon.connected"> <p>Photon is not Connected</p> </div> <div ...
0
votes
1answer
26 views

Vuex(store js) doesn't update the computed property only if I refresh the page

Hi I am making a get call in store js and I pass it as computed property in Movie.vue, when I refresh the page I get the real value if I change the view or I go back to the index the value will not ...
0
votes
1answer
32 views

VueX/VueJS: call mutation from another file

I'm searching the way to call a mutation on a store from another file which is not a single file component. This file is responsible to manage the axios configuration to be able to make some API ...
0
votes
2answers
55 views

Vuex getter not updating on state changes

I can't get a vuex getter to update, when a state object changes. I'm trying to get a vuex getter to return a total sum of the values in a state object, with a reduce function. // Mutation state....
1
vote
0answers
23 views

Flux: update array state

I have itemById in flux's state. // state.js { itemById: {}, } And have two components list1 list2. In these components, I get two different data itemIds via http to get items what I need, just ...
0
votes
1answer
25 views

Call Two Methods on Watch Function in VueJs

I need to call functions "getService" and "getTabs" on watch method. The problem is the other one gets called but the other one doesn't when i decided to change $route. Is there a problem in my code? ...
0
votes
0answers
12 views

Nuxt vuex store : getter is undefined

Trying to get the value from the store but getter values are coming undefined, The log inside the mutation shows that the state.empInfo has data But the Chrome Vue Devtool shows State is empty, and ...
0
votes
2answers
23 views

Not getting Data on update of link in Vue and Vuex

Can someone please tell me how can I update the data on getting the id from url. Like this I have a sidebar having some categories. category 1, category2, link on category1 and category 2 is ...
0
votes
0answers
12 views

Vuex vmodel with an array

So I know to use vmodel with vuex you use a computed property with a setter and getter, where the getter dispatches an action. How would this work when the property you want to bind with is an array? ...
0
votes
1answer
23 views

Trouble importing Vue mixins into Webpack / vue-loader environment

I’m having a small issue. Until this point, everything has been compiling fine, until trying to get mixins working properly. When creating one and using it all within a single file component – no ...
1
vote
1answer
37 views

Vuex commit does not trigger v-show

I'm trying vuex for the first time, I found that a v-show directive is not been triggered after mutation commit on the store // store.js import Vue from "vue" import Vuex from "vuex" const states = {...
0
votes
1answer
19 views

How can I access the router id in vuex store and to append it to Axios get method

Hi I am trying to get the id from router and to append it to axios get method. This is the code from store.js In normal Vue component you can do something like this: id:this.$router.id but in vuex ...
0
votes
1answer
14 views

VueJS v-for An Array of Key:Values From Store Using a Method

How can I use v-for to get an array of key:values from a store using a method? The CodePen is available here I appreciate any help. P.S. I've been on SO for 10yrs and someone/somehow deleted my ...

http://mssss.yulina-kosm.ru