el-dialog 嵌套子组件数据不刷新
<!-- 展示通道测量值 -->
<el-dialog :title="analogTitle" :visible.sync="analogOpen" width="400px" append-to-body @close="closeDialog">
<div>
<analogCurve v-if="reFresh" :mac="analogMac" :channelAddress="analogChannelAddress"/>
</div>
</el-dialog>
data定义:
reFresh: true,
methods:
closeDialog(){
this.$nextTick(()=>{
this.reFresh = false
})
//子组件刷新
reFreshChild(){
this.reFresh= false
this.$nextTick(()=>{
this.reFresh = true
})
},
打开dialog调用:
this.reFreshChild()