vue3中使用$forceUpdate
在vue2中使用
this.$forceUpdate()
在vue3中使用
import { getCurrentInstance } from "vue";
setup(){
//解构赋值 设置别名that,也可直接ctx
let {ctx:that} = getCurrentInstance()
that.$forceUpdate()
}
在vue2中使用
this.$forceUpdate()
在vue3中使用
import { getCurrentInstance } from "vue";
setup(){
//解构赋值 设置别名that,也可直接ctx
let {ctx:that} = getCurrentInstance()
that.$forceUpdate()
}