本人使用.sync修饰符,
// this.$emit('update:visible-a',false); //无效
this.$emit('update:visibleA',false); //有效
<modal:visible-a.sync="bool"></modal>
示例
visibleChange(val) {
if (!val) {
this.close();
} else {
this.form.password = null;
}
},
close() {
this.visible = false;
this.$emit("update:visibleA", false);
}