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("尼瑪你說行不行");}}便可實現同事咱們還能夠攜帶參數
相關文章
相關標籤/搜索