0👍
You can use nextTick. It’s allows you to do something after you have changed the data and VueJS has updated the DOM based on your data change, but before the browser has rendered those changed on the page.
0👍
Try changing this.onSuccess
to this.onSuccess.bind(this)
. onSuccess
is likely losing context while called as a callback within window.restEntity
- [Vuejs]-Debugging node/prime vue webapp in vs code not hitting break points
- [Vuejs]-How to reference a VueJS child component from a parent
0👍
Presumably your assignment is losing the reactivity enhancement of displayedNotification
. I would try to use a spread operation:
onSuccess(response) {
this.displayedNotification = { ... response.data};
}
$set
should have the same effect, but as you want to set the whole array, not single array elements, that would be a bit more difficult to use:
onSuccess(response) {
this.displayedNotification.splice(0); // empty the array
response.data.forEach((val, idx) => this.$set(this.displayedNotification , idx, val));
}
- [Vuejs]-Why does every component in my page appears twice?
- [Vuejs]-How to run a method in the background in vuejs
Source:stackexchange.com