A组件:
import editMenuDialog from "./editMenuList"
components:{"my-editMenuDialog":editMenuDialog}
<div v-show="addMenuListShow">
<my-addMenuDialog ref="addDialogVisible" @refaddMenuList="refaddMenuList"></my-addMenuDialog>
</div>
data:{
return{
addMenuListShow : false
}
}
method:{
custom(){
this.addMenuListShow = true;
this.$refs.addDialogVisible.search();
},
refaddMenuList(){
this.search(); //B组件调用search方法
}
}
B组件:
search(){
this.addDialog = true;
}
addForm(){
this.$emit("refaddMenuList") //调用A组件里面的search方法
}