I’m quite new with Vuejs & Vuex, I created a local project just to practice, so I have a file called: employeeList with an Array of objects. I’m trying to pass that same Array as state in Vuex, but is throwing me errors. I assume the syntax is wrong, please tell what would be the correct approach and if the
Tag: vuex
Calling method in my store returns empty observer object
I am new with Vue. I have a Vue component like below. The return value of my function getBuildingsByOwnerRequest is unexpected: It returns an empty observer object. Only if I run getBuildingsByOwnerRequest again I receive the expected output from my store action. Could this be a reactivity problem? buildings.js (store): Answer The object is empty at the time it’s logged.
I’m getting an object even though I’m returning an array from my javascript function
I have a function in a javascript file where I return an array. But when I call this function, when I look at the type with the “typeof” command, it returns an object instead of an array. My javascript file is here. Here is where I call and use this function. Although my variable named actions is an array, it
Nuxt SSR app does not share date from store between two windows
I have a Nuxt SSR app which need to open new window on link click, but new window does not have actual data in the store. There are only default values. How can I share actual values in the store between this two pagaes? This is the code of new page which ask for currency value: Answer Yes, if you
VueJS 3 / Vuex – How to display data from a nested json result
Dears, I’ve been struggling with this for hours, even following basics tutorials. I’m trying to display some data in Json in my Vue 3 project, when a data is in an array, using a loop I get everything I need, but if it isn’t in an array, I get an error or the data are stick together. I’ve created a
Vuex Action committing mutation
I have a vue app where a user can randomize a title and subtitle OR edit the fields using a custom input component. When a user chooses to edit, I’d like to send the updated title and subtitle from the input component to the store to mutate the title and subtitle state when clicking the save button after filling out
Vue.js render previous chat messages without changing the postition of current messages on screen
I use v-for to render the message list. when the first batch of messages are rendered, I use scrollIntoView() on the newest one so the container scrolls to bottom. as the user scrolls up I fetch previous messages to create a seamless scroll. the problem is that when new messages are rendered, the scroll goes to the top of the
Performance metrics for Vuejs
I’m looking for performance metrics for a Vue app. Metrics regarding the whole app but also for some specific components. I know that I can use Vue.config.performance = true; and then run the performance dev tools and maybe I could use something like Performance Observer in order to do specific things on new performance events. I was wondering, if there
Vuex | Be able to update outside of a mutation
I am trying to update a state of a action which is controlled through Vuex. I know initially, I am unable to update the state of the action without doing it directly through a mutation. However, I didn’t really want to do that as I am trying to use it in a callback. So I attempted to clone this array
Vuex state empty after reload
Inside a mutation I’m changing my state like: So the state shall hold an array with an object as the entry. Checking the state also shows the same. And it’s displayed on the view. When now reloading everything remains inside the state except of the object inside the array. It just shows an empty array inside the store: Nested_form is