Skip to content

Commit

Permalink
feat(Accordion): add close event (#2750)
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn authored Nov 25, 2024
1 parent 854bb81 commit 419a24f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/runtime/components/elements/Accordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand All @@ -142,6 +142,8 @@ export default defineComponent({
if (!isOpenBefore && isOpenAfter) {
emit('open', index)
} else if (isOpenBefore && !isOpenAfter) {
emit('close', index)
}
}
}, { immediate: true })
Expand Down

0 comments on commit 419a24f

Please sign in to comment.