1.子组件写一个方法
2.父组件
<div @click="showDetail(scope.row)">
<line-Ktj :region="this.region" ref="mychild"></line-Ktj>
</div>
showDetail(item){
this.$refs.mychild.getCode();
}
如果调用后报undefined,则
this.$nextTick(() => {
this.$refs.mychild.getCode();
})