When I manually modified the content of an element with a specified id, $setState became invalid. The data on the page has not changed
If the data is nested it is better using
this.$update() only, rather than
The version I am currently using is 5.7.13, and my attempt to use update is also invalid. There is my way of implementation on the picture, the div with id ke_0 still shows “hello” after update
When you do
.text('hello') it kills the reference to params thats why it does not change.
What happens if you check for DOM update callback, like this
this.$update(); this.$tick(() => console.log('Dom has been updated...'))
Yep, you shouldn’t do manual changes, do such changes by means on VDOM
Is there any way to make the execution of the method in the screenshot take effect? Because if it is a complex list data structure, I only want to change one of the small data. If setState is used, it will re-execute all methods written in DOM, which will consume resources. For example, for a dynamic list, I just want to change the number of likes for a certain dynamic.
it will re-execute all methods written in DOM
Not really, point of VDOM is that it will update only relevant elements in DOM