Questions tagged [vuex]

Vuex is a state management pattern + library for Vue.js applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion.

Vuex is a data management library by the creator of Vue.js. It is designed to help build larger applications in a more maintainable way by following principles similar to those made popular by Facebook’s Flux library (and subsequent iterations by community like redux).

Principles

  • Terse
  • Testable
  • Reactive
  • Single State Tree
  • Hot Reloading
  • Time Travel (with vue-devtools support)

GitHub: https://github.com/vuejs/vuex Documentation: https://vuex.vuejs.org/en/

7756 questions
2
votes
1 answer

Testing a getter that calls another getter, without mocking - or how to mount Vuex in tests?

I'm failing to understand something fundamental using Vuex: For a store that runs perfectly fine in the application, when running tests, due to dependency injection none of my getters that call other getters work. See the following store that has…
Overdrivr
  • 6,296
  • 5
  • 44
  • 70
2
votes
1 answer

mapActions not returning action from module

I am trying to add the Actions I created in my Vuex module to the Methods of my component. My component "HomePage.vue" looks like this import { PlusIcon } from "vue-feather-icons"; import TaskItem from "../TaskItem"; import moment from…
YaboiJ
  • 73
  • 4
2
votes
1 answer

Why can't apollo get data in first request?

I am using props to get the Id of birds. When I first start the app and click to enter the second-page, data won't load. It gives the following error; JS: [Vue warn]: Error in render: "TypeError: Cannot read property 'name' of undefined" JS: JS:…
Cem Kaan
  • 2,086
  • 1
  • 24
  • 55
2
votes
1 answer

Vue.js how to use tabs to load different components

I am trying to use a click event on my tabs to set the value of a variable inside data() I then use this variable in an if statement on my components to test the value and display the component if true. But this isn't working and I'm getting no…
Reece
  • 2,581
  • 10
  • 42
  • 90
2
votes
1 answer

Why is the store state of the vuex not stored in localStorage?

When I refresh the page, the store's state is all gone. This is very inconvenient when programming. When I looked up, there was a module called vuex-persist, which stores the state of vuex in localStorage. Why doesn't vuex store the state of vuex…
Rebbeca
  • 1,587
  • 2
  • 10
  • 12
2
votes
1 answer

Avoid conflict between Vuex an IAP plugin in Phonegap app

While developing a Phonegap app I use Vuex to manage app's state. So, I have at App.vue: // Import store import store from './vuex/store' Later I want to create an annual subscription, for which I use the cordova-plugin-purchase plugin…
hoozer
  • 23
  • 1
  • 5
2
votes
1 answer

VueJS String interpolation can access private attribute of TS object

Hi I recently start to learn vuejs by using typescript I made a model class using typescript and in it there are private attributes that need supposedly can only be accessed via getters and put it in vuex store But in the string interpolation…
Sen
  • 308
  • 2
  • 13
2
votes
1 answer

Displaying VueJS getter data in template / async

In a VueJS component named GlobeInformation.vue, I would like to call a getter "mapData" which I expect to return a manipulated version of my state's data, however when I display it in my template it shows up as an empty array. I've posted a…
Nik
  • 143
  • 2
  • 9
2
votes
1 answer

VueJS-I need help implementing re-rendering components

I am building a site where users can upload posts. Every user has a profile page where they can see what posts they have liked and what posts they have created. Over a created post there is a delete button. When I delete the post, it gets removed,…
2
votes
1 answer

firebase.auth().onAuthStateChanged getting null after refresh page in vuex

i am using Vuex and Firebase Authentication. I got stuck when reload the page. firebase.auth().onAuthStateChanged take time to response. But i need at the same time when reload the page. I have seen many tutorials in internet, most of them is router…
Mohamed Mamun
  • 211
  • 3
  • 15
2
votes
1 answer

How to use debounce with Vuex?

I am trying to debounce a method within a Vuex action that requires an external API. // Vuex action: async load ({ state, commit, dispatch }) { const params = { period: state.option.period, from: state.option.from, to:…
Michael
  • 6,561
  • 5
  • 38
  • 55
2
votes
1 answer

Toggling Vuetify navigation drawer v-modelled to Vuex variable

(I spied some similar questions, but none seemed to address my problem, however please refer if I missed something.) I'm using Vue, Vuex, and Vuetify. Working from the "Google Keep" example layout, I factored out the NavDrawer and AppBar components.…
TresPaul
  • 25
  • 5
2
votes
1 answer

How to convert Html5 bootstrap template to Vue app?

I have a good HTML 5 template and I want to convert it to the Laravel + Vue app. How should I do then? Thanks
Alain Roy
  • 145
  • 2
  • 16
2
votes
1 answer

Can I have multiple states in a Vuex store?

I have created a generic store for Products in my web app. Naturally there are very many different types of products the website needs to display on different pages. So I have ended up with multiple states to represent each one. Here is my…
volume one
  • 6,800
  • 13
  • 67
  • 146
2
votes
2 answers

How to use an API, that is initialized asynchronously, inside a Vuex state?

I'm introducing myself to Vue + Vuex and I'm having a hard time figuring out where to initialize an API that has an async initialization method. I obviously can't await outside an async function like this: import { RequestSystemProxy } from…
meci
  • 199
  • 6
1 2 3
99
100