Vue 3.0 中我们使用 reactive() 定义的响应式数据的时候,当我们对象再次赋值,我们发现数据已经修改成功,但是页⾯并没有自动渲染成最新的数据; 

使用vue的强制刷新处理

<script setup>
import { defineComponent , ref , computed , toRefs , getCurrentInstance} from 'vue'

const internalInstance = getCurrentInstance()
//操作数据后更新视图  例如tabledata= xxx后
internalInstance.ctx.$forceUpdate()

}

</script>

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐