-
子组件
<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>
标签:Vue,methods,default,child,组件,调子,childEvent
From: https://www.cnblogs.com/IT-IOS-MAN/p/16891356.html