vuex Questions
5
Solved
I am running ESLint and I am currently running into the following ESLint error:
error 'state' is already declared in the upper scope no-shadow
const state = {
date: '',
show: false
};
const...
4
How can I clone data from vuex state to local data attribute?
State
this.tsStore.shemes
Data Attribute
data () {
return { shemes: [] }
}
I've tried do this in updated () this.shemes = this.tsStor...
2
I would like to implement this kind of logic that assign this.$store.value to local data.
This is how I do in pages/index.vue for instance.
method: {
this.value = this.$store.value
}
I want to ...
3
Solved
Following from the Vuex documentation for organising the store modularly (https://vuex.vuejs.org/guide/modules.html), I have the following in:
store/index.js:
import Vue from "vue";
import Vuex f...
2
Solved
Using Vue and Vuex, I have followed the recommended practice of making changes to state only via mutations. So all Vue components will make changes to state via the use of an action which then in t...
1
Solved
Hi i have a requirement of combining 2 vuex store into a single store (both stores are of different projects)
import storeA from '/path';
import storeB from '/path';
now combined both store
const...
3
Solved
let's say I have following tree:
[
{
name: 'asd',
is_whatever: true,
children: [
{
name: 'asd',
is_whatever: false,
children: [],
},
],
},
],
The tree is stored in a module via Vuex u...
Cutcherry asked 13/8, 2017 at 21:30
2
Solved
I store token after success login call in vuex store like this:
axios.post('/api/auth/doLogin.php', params, axiosConfig)
.then(res => {
console.log(res.data); // token
this.$store.commit('lo...
Plano asked 22/12, 2017 at 19:51
5
Solved
Im building my app with VueJS and Vuex and I'm facing the issue when I have Multiple modules using the same data fields. Its about API configuration like dat.
getUsers ({ state, commit }) {
axios...
Gaultheria asked 18/1, 2018 at 17:38
4
Issue
✅ Vue 2:
computed properties are updated after vuex store mutation.
❌ Vue 3:
computed properties are not updated after vuex store mutation.
Vuex 4
Purpose: Get posts from Firestore. Add to &q...
4
Solved
I'm new to Vue.js Nuxt and all front-end stuff.
I have a question about API calls. I'm not sure what is the right way, the best practice here.
I have a store. In that store, I have actions that are...
4
I'm having a hard time making my vuex modules work with NuxtJS SSR, TypeScript and vuex-module-decorators.
I tried following guide from the official nuxt website and the vuex-module-decorators, bu...
Supinate asked 21/2, 2020 at 13:51
5
Solved
I have a Vue.js app. This app is using Vuex for state management. My store looks like this:
const store = new Vuex.Store({
state: {
items: []
},
mutations: {
MUTATE_ITEMS: (state, items) =&g...
Indopacific asked 8/6, 2018 at 19:21
4
Solved
I'm trying to get a Vuex store to be Typescript friendly. I'm building the store as explained here. However, when I access this.$store from a component, the type is Store<any> .
I couldn't ...
Yungyunick asked 4/11, 2018 at 10:45
2
Solved
Is it possible to dispatch an action between namespaced modules?
E.g. I have Vuex modules "gameboard" and "notification". Each are namespaced. I would like to dispatch an action...
Mcnalley asked 23/3, 2017 at 18:26
2
Solved
I want to add the class menu-opened on the body tag when I click on the menu burger div.
My div
<div v-on:click="openMenu"></div>
The openMenu method
methods: {
openMenu() {
cons...
4
Fiddle : here
I am creating a webapp with Vue 2 with Vuex. I have a store, where I want to fetch state data from a getter, What I want is if getter finds out data is not yet populated, it calls di...
Basion asked 18/11, 2016 at 13:46
3
Both data() and async data() gives the same result (and it is obvious that the results from asyncData() override the results from data())
and both results in HTML code in the source code (i.e the ...
8
Solved
My app uses the Firebase API for User Authentication, saving the Login status as a boolean value in a Vuex State.
When the user logs in I set the login status and conditionally display the Login/L...
Stillhunt asked 26/3, 2017 at 10:19
2
I am working on nuxt-edge + auth.nuxt + vuex project and in the nuxtServerInit method of the store I am only logging a message in the console. When the site is reloaded the message gets printed mul...
2
Solved
I recently was struggling with implementing modules in Vuex for the first time. I couldn't find much info on the console error message I was getting ( rawModule is undefined ), so I thought I'd sha...
4
Solved
I would like to know whats the correct way of using ...mapActions([]) within a Typescript vue class component.
this is how I do it:
<script lang="ts">
import { Component, Prop, Vue } from "...
Belshin asked 6/2, 2020 at 16:16
6
Solved
NuxtServerInit is not working on initial page render on nuxt js vuex module mode. But it works on Classic mode. Following code is the flow I used.
My api call
api/CategoryApi.js
import axios fro...
Millman asked 28/2, 2019 at 12:26
3
Solved
I'm trying to test a basic Vue Component that makes reference to a Vuex store. I thought I followed Vue's example (https://vue-test-utils.vuejs.org/guides/using-with-vuex.html#mocking-getters) to a...
Converge asked 5/2, 2019 at 1:23
3
Solved
I used nklayman/vue-cli-plugin-electron-builder to create an electron app prepared with Vue/Vuex. It ships with files main.js, background.js including Vue component starting point. But I can't get ...
© 2022 - 2024 — McMap. All rights reserved.