VUE 3 view does not match data

        In vue3 development, due to the use of ref and reactive as responsive data, generally there will be no delay in view update, but I use components in the development of the project, and after the route is passed to the page, it will be passed by The page passes parameters to the component. It seems that there is a problem of view update delay due to too many parameter levels. Later, I consulted the information and asked Baidu, and found that vue3 also has a strategy to deal with this problem.

         Introduce the getCurrentInstance method from inside Vue. If it is too long, you can customize a variable to access this method, and then make the following call in the place where the view is not updated

        After I request the data, the table is not updated, so I call the view update method after the data is requested and processed, so that the attempt will display the correct content according to the data.

 

Guess you like

Origin blog.csdn.net/xianyus4mA/article/details/129293755