feat: 添加输入组件并更新 UI 组件页面布局
All checks were successful
/ depcheck (push) Successful in 2m31s
/ lint-build-and-check (push) Successful in 2m34s
/ build-and-deploy-to-vercel (push) Successful in 3m37s
/ surge (push) Successful in 2m54s
/ playwright (push) Successful in 5m22s

This commit is contained in:
mini2024
2025-03-24 00:54:43 +08:00
parent 22d3eedea0
commit cf95ef7e8e
3 changed files with 58 additions and 25 deletions

View File

@ -0,0 +1,24 @@
<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
modelValue?: string | number
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>

View File

@ -0,0 +1 @@
export { default as Input } from './Input.vue'