diff --git a/src/runtime/components/elements/Accordion.vue b/src/runtime/components/elements/Accordion.vue index 4aafd1c72c..0d819dc4dd 100644 --- a/src/runtime/components/elements/Accordion.vue +++ b/src/runtime/components/elements/Accordion.vue @@ -126,7 +126,7 @@ export default defineComponent({ default: () => ({}) } }, - emits: ['open'], + emits: ['open', 'close'], setup(props, { emit }) { const { ui, attrs } = useUI('accordion', toRef(props, 'ui'), config, toRef(props, 'class')) @@ -142,6 +142,8 @@ export default defineComponent({ if (!isOpenBefore && isOpenAfter) { emit('open', index) + } else if (isOpenBefore && !isOpenAfter) { + emit('close', index) } } }, { immediate: true })