父组件代码
<template>
<div>
我是父组件
<borderTable ref="child"></borderTable>
</div>
</div>
</template>
<script>
import borderTable from '../tables/borderTable.vue'
export default {
components: {
borderTable
},
methods: {
fangfa:function () {
this.$refs.child.panduan();
}
}
}
</script>
子组件代码
<template>
<div>我是子组件</div>
</template>
<script>
import borderTable from '../tables/borderTable.vue'
export default {
components:{
borderTable
},
methods: {
panduan(){
alert(“我是子组件我被调用了”)
}
}
}
</script>
<style scoped>
</style>