vue父组件调用子组件方法
父组件:
代码
<sampleapplylinemodel ref="sampleapplylinemodel" @reLoad="_fetchRecords" :OrdSampleApplyId="this.new_ord_sampleapplyid"></sampleapplylinemodel>
import sampleapplylinemodel from "@/module/sample/sampleapplylinemodel";
调用方法:
代码
this.$refs.sampleapplylinemodel.callMethod();
子组件方法:
代码
methods: { callMethod () { alert("调用成功"); } }