Files
vue-ts-example/src/shadcn/components/ui/input/Input.vue
严浩 46e5fd3e49 refactor(shadcn): 优化 Button 组件并更新相关依赖
- 更新 @types/node 版本至 24.3.0
- 更新 @vue/tsconfig 版本至 0.8.0
- 更新 eslint-plugin-oxlint 和 oxlint 版本至 1.12.0
- 优化 HCesiumManager 中的卫星实体创建逻辑
- 修复 ShadcnVue 页面中的 Button 组件用法
- 优化 Button 组件的 Props 类型定义
- 更新 buttonVariants 的导入路径
2025-08-18 10:18:03 +08:00

25 lines
930 B
Vue

<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/shadcn/lib/utils'
import { useVModel } from '@vueuse/core'
const props = defineProps<{
defaultValue: string | number | undefined
modelValue: string | number | undefined
class?: HTMLAttributes['class']
}>()
const emits = defineEmits<{
(e: 'update:modelValue', payload: string | number): void
}>()
const modelValue = useVModel(props, 'modelValue', emits, {
passive: true,
defaultValue: props.defaultValue,
})
</script>
<template>
<input v-model="modelValue" :class="cn('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', props.class)">
</template>