🛠️

19302 工具站

在线工具集合

文章/vue3中使用$forceUpdate

vue3中使用$forceUpdate

2022年04月12日2,546 次阅读⏱ 约 1 分钟Vue3

在vue2中使用

this.$forceUpdate()

在vue3中使用

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

💬评论(0)

💭

暂无评论