Add parent div on slot to allow custom trigger on Dropdown and transition prop + element to Dropdown content
This commit is contained in:
5142
package-lock.json
generated
5142
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="inline-flex relative" ref="wrapper">
|
<div class="inline-flex relative" ref="wrapper">
|
||||||
|
<div class="inline-flex items-center">
|
||||||
<slot name="trigger" :show="onShow" :hide="onHide" :toggle="onToggle">
|
<slot name="trigger" :show="onShow" :hide="onHide" :toggle="onToggle">
|
||||||
<Button @click="onToggle">
|
<Button @click="onToggle">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
@@ -8,9 +9,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</Button>
|
</Button>
|
||||||
</slot>
|
</slot>
|
||||||
<div ref="content" :style="contentStyles" :class="[{ hidden: !visible }, contentClasses]">
|
</div>
|
||||||
|
<Transition :name="transition">
|
||||||
|
<div ref="content" v-if="visible" :style="contentStyles" :class="[{ hidden: !visible }, contentClasses]">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
</Transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -36,6 +40,10 @@ const props = defineProps({
|
|||||||
type: String ,
|
type: String ,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
transition: {
|
||||||
|
type: String ,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const content = ref<HTMLDivElement>()
|
const content = ref<HTMLDivElement>()
|
||||||
|
|||||||
Reference in New Issue
Block a user