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("尼玛你说行不行");
}
}

即可实现同事我们还可以携带参数


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM