A
A
AE422020-06-11 17:41:02
Vue.js
AE42, 2020-06-11 17:41:02

Why is data saved when switching between pages?

Hello.

I have an array of data and different mutations with it
For example:
Initial array const arr = []
After we received data from the server arr = [{id: 1}, {id: 2}, {id: 3}] - these I pass the data to the child component . I
perform an action on it, it becomes like this: arr = [{id: 1, active: true}, {id: 2}, {id: 3}]

Now, if you switch to another page, and then again on the same one, then the array will remain the same

Data is coming to network, but for some reason they do not replace arr = [{id: 1, active: true}, {id: 2}, {id:3}] array

How to fix this ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question