首页 > 其他 > 详细

调用其他组件里面的方法--随笔

时间:2020-04-02 17:00:42      阅读:51      评论:0      收藏:0      [点我收藏+]
 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方法 }

 

调用其他组件里面的方法--随笔

原文:https://www.cnblogs.com/0520euv/p/12620721.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!