文章/前端/vue3中使用$forceUpdate

vue3中使用$forceUpdate

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

在vue2中使用

this.$forceUpdate()

在vue3中使用

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

评论(0)

暂无评论

暂无评论

来说点什么吧