소스 검색

♻️ refactor(ui): 扩展 Textarea 组件的 value 类型支持

- 修改 TextareaProps 接口,允许 value 为 string | number | readonly string[] | null 类型
- 增强组件对不同数据类型输入值的兼容性
yourname 4 달 전
부모
커밋
7f4b586f45
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/client/components/ui/textarea.tsx

+ 1 - 1
src/client/components/ui/textarea.tsx

@@ -3,7 +3,7 @@ import * as React from "react"
 import { cn } from "@/client/lib/utils"
 
 interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value'> {
-  value?: string | null
+  value?: string | number | readonly string[] | null
 }
 
 function Textarea({ className, value, ...props }: TextareaProps) {