Vue 3.0 中我們使用 reactive() 定義的響應(yīng)式數(shù)據(jù)的時(shí)候,當(dāng)我們對(duì)象再次賦值,我們發(fā)現(xiàn)數(shù)據(jù)已經(jīng)修改成功,但是頁(yè)?并沒(méi)有自動(dòng)渲染成最新的數(shù)據(jù);
使用vue的強(qiáng)制刷新處理
<scriptsetup>
import {defineComponent , ref , computed , toRefs , getCurrentInstance} from 'vue'
constinternalInstance = getCurrentInstance()
//操作數(shù)據(jù)后更新視圖 例如tabledata= xxx后
internalInstance.ctx.$forceUpdate()
}文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-583570.html
</script>文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-583570.html
到了這里,關(guān)于vue3中數(shù)據(jù)更新,視圖沒(méi)有更新解決方案的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!