vue组件传值

组件中定义事件

getServiceActive(index,text) {
this.active_type = index;
if(text=="全部")
{
text=null;
}
this.type_text=text;
this.$emit("ListenChildEvent",{"type_text":this.type_text,"state_text":this.state_text});
},

页面中引用组件

<ServiceChoice v-on:ListenChildEvent="showChild" />

showChild: function(data) {
this.sreviceType = data.type_text;
this.status = data.state_text;
},

posted @ 2019-09-29 10:03  艺洁  阅读(143)  评论(0编辑  收藏  举报