vue+iview子组件调用父组件的方法
找了好多方法都没有调用成功,用以下的方法可以成功调用:
1.父页面代码如下:
<detail-form ref="detailFormRef" v-bind:id="tempalteId" v-on:childMethod="closeDrawer"/>
在methon内添加closeDrawer方法:
methods: {
closeDrawer(){
console.log("调用成功");
},
},
2.子页面调用:
that.$emit('childMethod');