通过ref调用即可,但是ref是dom节点出来之后才能用的,也就是render函数执行完毕,mounted钩子之后
<template>
<div>
<button @click="clickParent">点击</button>
<child ref="mychild"></child>
</div>
</template>
<script>
import Child from './child';
export default {
name: "parent",
components: {
child: Child
},
methods: {
clickParent() {
this.$refs.mychild.parentHandleclick("I'm dad");
}
}
}
</script>