子組件
<template>
<div>
</div>
</template>
<script>
export default {
methods: {
childEvent(_value) {
alert("我是子組件方法" + _value);
}
}
};
</script>
父組件
<template>
<div>
<child ref="child"/>
</div>
</template>
<script>
import child from './child';
export default {
components: {
child
},
methods: {
parentEvent() {
this.$refs.child.childEvent(“IT_IOS_MAN);
}
}
};
</script>