修改文本域长度

This commit is contained in:
筱野
2026-01-26 22:51:01 +08:00
parent de8677c64c
commit 4a6ac73ad7

View File

@@ -29,8 +29,10 @@ const TextareaTag: React.FC<TextareaTagProps> = ({
// 处理文本输入变化
const handleTextChange = useCallback((val: string) => {
console.log(val,'e.detail.value')
onChange({...value, description: val})
}, [onChange])
const maxAllowedLength = Math.floor(maxLength * 1.2)
const truncatedVal = val.length > maxAllowedLength ? val.slice(0, maxAllowedLength) : val
onChange({...value, description: truncatedVal})
}, [onChange, maxLength, value])
// 处理标签选择变化
const handleTagChange = useCallback((selectedTags: string[]) => {