【发布时间】:2021-07-11 08:05:39
【问题描述】:
大家好:我有一个模式,我希望按钮通过插槽传递,每个插槽都有自己的事件。问题是当我点击按钮时,事件会触发但父级听不到。
<template>
<modal-detail v-if="viewModal" title="Modifica brands" @close="viewModal=false">
<!-- <template #header><p>ciao bob</p></template> -->
<template #body>
sdfgsfgddd
</template>
<template #actions>
<button-cancel buttonText="cancella" @click="$emit('close')"></button-cancel>
<button-confirm buttonText="conferma" @click="$emit('confirm')"></button-confirm>
</template>
</modal-detail>
</template>
问题是 @close="something" 从未被调用过。
建议?
谢谢大家
【问题讨论】:
标签: vue.js components eventemitter slot