watch: {
modalShow(to) {
if (to) {
// this.standardData = JSON.parse(JSON.stringify());
this.standardData =[...this.templateFrom.templet]
this.title = this.templateFrom.templetName;
} else {
this.standardData = [];
this.title = '';
}
},
},
vue父向子传值 防止 深拷贝
最新推荐文章于 2024-09-05 20:24:22 发布
本文探讨了在Vue.js中使用模态框进行动态数据加载的策略。具体介绍了如何根据模态框的显示状态更新组件的数据,确保数据的实时性和准确性。通过监听watch属性,实现了模态框打开时从模板获取数据并展示,关闭时清空数据,保持界面的整洁。
570

被折叠的 条评论
为什么被折叠?



