0
点赞
收藏
分享

微信扫一扫

vue强制更新子组件

何以至千里 2022-02-08 阅读 49

1、强制重新刷新某组件

this.$forceUpdate()

 2、绑定 key

//模版上绑定key
<SomeComponent :key="theKey"/>
//选项里绑定data
data(){
  return{
      theKey:0
  }
}
//刷新key达到刷新组件的目的
theKey++;

3、v-if

举报

相关推荐

0 条评论