Solve the problem that the data update view does not update in the vue3 setup syntax

In the process of using vue3, there are scenarios where two-dimensional arrays are used. When operating on the internal array, the responsive value has changed, but the view has not been modified. Currently, forced refresh is used to solve this problem. The code is as follows

import {
    
     defineComponent , ref , computed , toRefs , getCurrentInstance} from 'vue'
setup(){
    
    
const internalInstance = getCurrentInstance()
//操作数据后更新视图
internalInstance.ctx.$forceUpdate()
return {
    
    
internalInstance
}
}


	```

Guess you like

Origin blog.csdn.net/weixin_44064067/article/details/124258711