<template>
<parent-component @my-event="doSomething"></parent-component>
</template>
<script>
export default {
name: "About",
emits: ["myEvent"],
setup(props, { emit }) {
emit("myEvent")
}
}
</script>
没有运行成功,为什么?怎么运行?
<template>
<parent-component @my-event="doSomething"></parent-component>
</template>
<script>
export default {
name: "About",
emits: ["myEvent"],
setup(props, { emit }) {
emit("myEvent")
}
}
</script>
没有运行成功,为什么?怎么运行?