vue & modal props & form data update bug
vue & modal props & form data update bug
OK
<div>
<BindModal
:dialogBindVisible="dialogBindVisible"
:dialogBindData="dialogBindData"
@close-bind-item="closeBindItem"
@save-bind-item="saveBindItem"
/>
<EditModal
:dialogEditVisible="dialogEditVisible"
:dialogEditData="dialogEditData"
@close-edit-item="closeEditItem"
@save-edit-item="saveEditItem"
/>
</div>
watch: {
dialogBindVisible(newProp, oldProp){
if(newProp !== oldProp) {
this.activityId = "";
log(`newProp, oldProp`, newProp, oldProp);
}
this.visible = newProp;
},
dialogBindData(newProp, oldProp){
this.form = {
...this.form,
...newProp,
};
},
},
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/12193076.html
未经授权禁止转载,违者必究!