一、父组件调用子组件的方法
①父组件
<j-upload-modal v-model="filePath" bizPath="importExcel" :number="1" ref="Child"></j-upload-modal>
<a-button @click="handleOk">完成</a-button>
handleOk(){
this.$refs.Child.childMethods();
},
②子组件
childMethods(){
console.log('调用子组件');
},
二、子组件调用父组件的方法
①父组件
<message-reminder-page @fn='getCountAll' @fatherMethod="onCloseInfo"></message-reminder-page>
onCloseInfo(){
this.messageReminderSatus = false;
},
②子组件
<button @click="details(item)">按钮</button>
details(){
this.$emit('fatherMethod');
}