How to exclude the specified property change view from refreshing by v-for in vue+vuex

The

scenario is like this. I designed an im chat app where vuex is used to manage data between pages. The data structure is like [{id,name,msg []}, {id,name,msg []}]. The data I use in the friend list page is id,name, and then click on a friend to enter the chat interface and store the chat information in the friend"s msg array, thus there is a problem that if the chat message adds one piece of data, returning to the friend list page will cause the page data to be rebound, which affects the efficiency. The solution I"ve come up with is to split msg separately, but it"s tricky to involve too much business logic. I"m also a novice at vue. I just want to ask if there"s any good way to deal with it. The best way is not to detect the variable msg on the friend list page.


returning to the buddy list page will cause the page data to be rebound, which affects efficiency

as long as you don't bind msg to html , maintain a new variable to replace this msg .

Menu