Answer the question
In order to leave comments, you need to log in
Reactivity on Vue? How to update a component?
I receive data from the server. It is required to redraw the component every time new data arrives, how to implement it? Where is the mistake? Tell me please
methods:{
newvalue(data, whichScreen){
if(whichScreen){
console.log("попал");
console.log(data);
this.firstWindow = Object.assign({}, this.firstWindow, data);
}else{
this.secondWindow = Object.assign({}, this.secondWindow, data);
}
}
}
Answer the question
In order to leave comments, you need to log in
It is required to redraw the component every time new data arrives, how to implement?
this.firstWindow = Object.assign({}, this.firstWindow, data);
methods:{
newvalue(data, whichScreen){
if(whichScreen){
console.log("попал");
console.log(data);
Vue.set(this.windows, 'firstWindow', Object.assign({}, this.firstWindow, data));
}else{
Vue.set(this.windows, 'secondWindow', Object.assign({}, this.secondWindow, data));
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question