mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-26 01:40:34 +01:00
docs(app): framework select global (#2719)
Co-authored-by: harlan <harlan@harlanzw.com>
This commit is contained in:
25
docs/app/components/FrameworkSelect.vue
Normal file
25
docs/app/components/FrameworkSelect.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
const { framework, frameworks } = useSharedData()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UDropdownMenu
|
||||
v-slot="{ open }"
|
||||
:modal="false"
|
||||
:items="frameworks"
|
||||
:ui="{ content: 'w-(--radix-dropdown-menu-trigger-width)' }"
|
||||
>
|
||||
<UButton
|
||||
color="neutral"
|
||||
variant="outline"
|
||||
v-bind="frameworks.find(f => f.value === framework)"
|
||||
block
|
||||
trailing-icon="i-lucide-chevron-down"
|
||||
:class="[open && 'bg-[var(--ui-bg-elevated)]']"
|
||||
:ui="{
|
||||
trailingIcon: ['transition-transform duration-200', open ? 'rotate-180' : undefined].filter(Boolean).join(' ')
|
||||
}"
|
||||
class="-mx-2 w-[calc(100%+1rem)]"
|
||||
/>
|
||||
</UDropdownMenu>
|
||||
</template>
|
||||
Reference in New Issue
Block a user