Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Accordion): add close event #2750

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

hansemannn
Copy link

@hansemannn hansemannn commented Nov 24, 2024

This PR adds the new "close" event for UAccordion, so both "open" and "close" are properly supported.

Example:

<template>
  <UContainer class="min-h-screen flex items-center">
    <UCard class="flex-1" :ui="{ background: 'bg-gray-50 dark:bg-gray-800/50', ring: 'ring-1 ring-gray-300 dark:ring-gray-700', divide: 'divide-y divide-gray-300 dark:divide-gray-700', header: { base: 'font-bold' } }">
      <p class="text-gray-500 dark:text-gray-400">
        <UAccordion :items="[{ label: 'Test me' }]" @open="onOpen" @close="onClose" />
      </p>
    </UCard>
  </UContainer>
</template>

<script setup>
function onOpen() {
  alert('open!')
}
function onClose() {
  alert('close!')
}
</script>

Fixes #2745

@hansemannn hansemannn force-pushed the feature/accordion-close-event branch from 41711c6 to c17ba64 Compare November 24, 2024 22:23
@benjamincanac benjamincanac changed the title feat: add “close” event to UAccordion component feat(Accordion): add close event Nov 25, 2024
@benjamincanac benjamincanac merged commit 419a24f into nuxt:dev Nov 25, 2024
2 checks passed
@benjamincanac
Copy link
Member

Thanks! 😊

@hansemannn hansemannn deleted the feature/accordion-close-event branch November 25, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"close" event for Accordion component?
2 participants