iview在子组件中调用父组件的方法

子组件
<button @click='increment()'>点击</button>
increment:function(){
this.mycontent=10;
alert(this.mycontent);
this.$emit("increment",this.mycontent);
}

父组件
<can-edit-table
refs="table4"
v-model="editInlineAndCellData"
@increment = "demo"
:editIncell="true"
:columns-list="editInlineAndCellColumn"
></can-edit-table>
methods: {
demo(){
alert("尼玛你说行不行");
}
}

即可实现同事我们还可以携带参数
posted @ 2018-05-09 15:31  一叶*秋  阅读(2920)  评论(0编辑  收藏  举报

博客侧边栏公告广告位招租