mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
引入项目基础目录结构,包含多语言支持、主要页面与组件、核心游戏逻辑、UI 组件库、加密与本地持久化、自动化 Docker 构建流程、GitHub issue 模板(中英文)、README(中英文)、LICENSE 及开发配置文件。实现 OGame 单机版主要功能模块,为后续开发和扩展奠定基础。
35 lines
1.7 KiB
Vue
35 lines
1.7 KiB
Vue
<template>
|
|
<SelectTrigger
|
|
data-slot="select-trigger"
|
|
:data-size="size"
|
|
v-bind="forwardedProps"
|
|
:class="
|
|
cn(
|
|
'border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*=\'text-\'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
|
|
props.class
|
|
)
|
|
"
|
|
>
|
|
<slot />
|
|
<SelectIcon as-child>
|
|
<ChevronDown class="size-4 opacity-50" />
|
|
</SelectIcon>
|
|
</SelectTrigger>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import type { SelectTriggerProps } from 'reka-ui'
|
|
import type { HTMLAttributes } from 'vue'
|
|
import { reactiveOmit } from '@vueuse/core'
|
|
import { ChevronDown } from 'lucide-vue-next'
|
|
import { SelectIcon, SelectTrigger, useForwardProps } from 'reka-ui'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
const props = withDefaults(defineProps<SelectTriggerProps & { class?: HTMLAttributes['class']; size?: 'sm' | 'default' }>(), {
|
|
size: 'default'
|
|
})
|
|
|
|
const delegatedProps = reactiveOmit(props, 'class', 'size')
|
|
const forwardedProps = useForwardProps(delegatedProps)
|
|
</script>
|