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("调用成功");
    }
  }
posted @ 2018-05-25 14:32  冷战  阅读(1968)  评论(0编辑  收藏  举报