vue 组件的销毁重建

代码:<v-detection :detectionid="detectionid" v-if="hackReset"></v-detection>

声明hackReset,利用true或者false实现重建或者销毁

代码:
     this.hackReset = false;//销毁组件
     this.$nextTick(() => {
       this.hackReset = true;//重建组件
     });

猜你喜欢

转载自blog.csdn.net/shen_qiu/article/details/81564117