1
I’m Dev Ror and I’m in my initial studies with Vuejs. To do so, I started creating a Todolist with Firebase for data persistence and a problem occurred to me.
I created a function to return data from Firebase.
So, when there is a change or inclusion of some data in the database, Firebase returns all the data that is presented through this instance of Vue.
https://github.com/luizpicolo/ToDo.list/blob/8e2ba8cba714a9541ef0c91cf38d4ae69ae915c7/js/main.js#L1
However, when making the first call of the function listTasks()
, in line 4 on the link above, it returns me the data correctly. But when there is the change, the vector is not reassembled, but concatenated with the new values, that is, I have duplicate data.
How would you make so that, whenever there was new data or change, Vue does not concatenate the vector?
I believe it is something of Vue through all the tests I have done so far. But this is just an achimos initially.
What is Dev Ror?
– Woss
@Andersoncarloswoss Understood as being Developer Ruby On Rails
– Pedro Martins
Do not edit a question to show that it has been resolved. Instead, put the resolution as a response and accept it.
– Rosário Pereira Fernandes
According to your guidelines, the topic has been corrected. Thanks for the tip @Rosáriopereirafernandes
– Luiz Picolo