el-dialog组件在关闭时,会触发子组件的created/mounted生命周期。原因是设置了destroy-on-close为true,所以会在关闭时会触发 created。
解决:
取消 destroy-on-close 的使用,如果需要进行销毁dialog中的元素,可以使用 v-if
具体原理可以参考:(2条消息) el-dialog destroy-on-close的坑(关闭弹窗时触发了子组件的mounted)_destroyonclose_帅比九日的博客-CSDN博客
el-dialog组件在关闭时,会触发子组件的created/mounted生命周期。原因是设置了destroy-on-close为true,所以会在关闭时会触发 created。
解决:
取消 destroy-on-close 的使用,如果需要进行销毁dialog中的元素,可以使用 v-if
具体原理可以参考:(2条消息) el-dialog destroy-on-close的坑(关闭弹窗时触发了子组件的mounted)_destroyonclose_帅比九日的博客-CSDN博客