在vue2中直接

this.$forceUpdate()

在vue3中直接

import { getCurrentInstance } from "vue";
setup(){
//解构赋值 设置别名that  也可不写  :that  直接ctx
//ctx 得到普通对象
//proxy得到响应式对象
// 推荐使用proxy
  	let {ctx:that, proxy} = getCurrentInstance()
	that.$forceUpdate()
}
Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐