fix: fixed borders
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
<template>
|
||||
<div
|
||||
:class="{ hidden: !panelState.isVisible }"
|
||||
class="p-5 border [&:not(:last-item)]:border-b-0 last:border-t-0 border-gray-200 dark:border-gray-700 dark:bg-gray-900"
|
||||
:class="{
|
||||
hidden: !panelState.isVisible,
|
||||
'border-b-0': panelState.order !== panelsCount - 1,
|
||||
'border-t-0': panelState.order === panelsCount - 1,
|
||||
}"
|
||||
class="p-5 border border-gray-200 dark:border-gray-700 dark:bg-gray-900"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
@@ -14,7 +18,8 @@ import { computed, inject } from 'vue'
|
||||
const accordionId: any = inject('accordionId')
|
||||
const panelId: any = inject('panelId')
|
||||
|
||||
const { accordionsStates } = useAccordionState()
|
||||
|
||||
const { accordionsStates } = useAccordionState()
|
||||
const panelState = computed(() => accordionsStates[accordionId].panels[panelId])
|
||||
const panelsCount = computed(() => Object.keys(accordionsStates[accordionId].panels[panelId]).length)
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user