I am using regular Vue.js in my project. I store data in a store made from scratch and use it in a template:
VUEX, what to do when $store.state is null
When users are not logged into my website, the state of user is set to null. However, this throws up a lot of issues on some pages where i look to see if this.$store.user For example, if I were to have a simple check such as and the user is not logged in (thus, setting […]
uploading and downloading storage images in firebase with VueJs
im building this simple application using Vue/vuex and firebase where i want to facilitate users upload images and once the app gets updated those images get reached from firebase storage , modifying the current database with the new uploaded image Here is my code: the images get push to the firebase storaged but once i […]
How to save data in Vue instance
The question is quite simple, All I want is to get the data after the AJAX post saved in Vue instace’s data. Here is my code: And after I trigger the getUserAcc(id) method,I try to verify the VMList.user value in browser console,and I get only the id.Seems like after the function is over the data […]
How to prevent any routing before some async data (in Vuex store) has loaded?
In my application I need some data to be loaded inside the VueX store before routing starts (for example user sessions). An example of a race condition would be the following: // In routes …
vuex empty state on logout
Quick story of my problem: Absolutely no data is stored in my vuex state when the page loads If the user is logged in(or has info stored in window.localStorage and therefore gets auto logged in) my …
vue.js 2 how to watch store values from vuex
I am using vuex and vuejs 2 together. I am new to vuex, I want to watch a store variable change. I want to add the watch function in my vue component This is what I have so far: import Vue from ‘…
How to navigate using vue router from Vuex actions
I am creating a web app with Vue 2.x and Vuex 2.x. I am fetching some information from a remote location via an http call, I want that if that call fails I should redirect to some other page. …