Closed renatorib closed 8 years ago
Well, It worked with jQuery extend (or underscore/lodash extend)
$.extend(this.data, resData);
But I still don't understand how it works.
var items = {
data: [],
fetch: function(query){
doAsyncFetch(query, function(resData){
Vue.set(this, 'data', resData);
});
}
}
are sure 'this' is really 'this'?
Yes, it's only an example I've writed, but is really 'this'.
I already solved this problem in vue forums :D Thanks
Can you share your solve?
1 year ago, I don't remember, sorry.
Hello, In my project, I have this store:
And in my component, I've setted:
But when I fetch store with
items.fetch(someQuery)
, theitems.data
are updated, but$vm.items
don't update.If I replace
Vue.set(this, 'data', resData);
forthis.data = resData
doesn't works too. The only way that works is when I useitems.data.push({});
, but I can't push an entire array, I need replace.Help me understand how works reactive sync, please. Thanks!