Data update in vue3, view not updated solution

In Vue 3.0, when we use the responsive data defined by reactive() , when our object is assigned again, we find that the data has been modified successfully, but the page is not automatically rendered with the latest data;

Forced refresh processing using vue

<scriptsetup>

import {defineComponent , ref , computed , toRefs , getCurrentInstance} from 'vue'

constinternalInstance = getCurrentInstance()

//Update the view after operating the data, for example, after tabledata= xxx

internalInstance.ctx.$forceUpdate()

}

</script>

Guess you like

Origin blog.csdn.net/Yang_Ming_Lei/article/details/129770586