Skip to content

Commit

Permalink
fix: read Headless' docs
Browse files Browse the repository at this point in the history
  • Loading branch information
noook committed Mar 30, 2024
1 parent caa8af0 commit 1c1b617
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions src/runtime/components/elements/Accordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,11 @@
@before-leave="onBeforeLeave"
@leave="onLeave"
>
<DefinePanelTemplate>
<HDisclosurePanel :class="[ui.item.base, ui.item.size, ui.item.color, ui.item.padding]" static>
<slot :name="item.slot || 'item'" :item="item" :index="index" :open="open" :close="close">
{{ item.content }}
</slot>
</HDisclosurePanel>
</DefinePanelTemplate>

<div v-if="unmount && open">
<PanelTemplate />
</div>
<template v-else>
<div v-show="open">
<PanelTemplate />
</div>
</template>
<HDisclosurePanel :class="[ui.item.base, ui.item.size, ui.item.color, ui.item.padding]" :unmount="unmount">
<slot :name="item.slot || 'item'" :item="item" :index="index" :open="open" :close="close">
{{ item.content }}
</slot>
</HDisclosurePanel>
</Transition>
</HDisclosure>
</div>
Expand All @@ -63,7 +52,6 @@
<script lang="ts">
import { ref, computed, toRef, defineComponent, watch } from 'vue'
import type { PropType } from 'vue'
import { createReusableTemplate } from '@vueuse/core'
import { Disclosure as HDisclosure, DisclosureButton as HDisclosureButton, DisclosurePanel as HDisclosurePanel, provideUseId } from '@headlessui/vue'
import UIcon from '../elements/Icon.vue'
import UButton from '../elements/Button.vue'
Expand Down Expand Up @@ -183,8 +171,6 @@ export default defineComponent({
provideUseId(() => useId())
const [DefinePanelTemplate, PanelTemplate] = createReusableTemplate()
return {
// eslint-disable-next-line vue/no-dupe-keys
ui,
Expand All @@ -197,8 +183,6 @@ export default defineComponent({
onBeforeLeave,
onAfterEnter,
onLeave,
DefinePanelTemplate,
PanelTemplate,
}
}
})
Expand Down

0 comments on commit 1c1b617

Please sign in to comment.