From 1fa9f2942256bbb975e2dbf276c7c17d2aa096cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=BD=95=E5=90=8C=E5=AD=A6?= Date: Mon, 4 Mar 2024 11:18:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(textarea):=20=E4=BF=AE=E5=A4=8D=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AF=BC=E5=87=BA=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/nutui/components/textarea/index.ts | 1 + packages/nutui/components/textarea/textarea.ts | 4 ++-- packages/nutui/components/textarea/textarea.vue | 6 +----- packages/nutui/components/textarea/type.ts | 17 +++++++++++++++-- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/packages/nutui/components/textarea/index.ts b/packages/nutui/components/textarea/index.ts index 78f0f959..b73e08b3 100644 --- a/packages/nutui/components/textarea/index.ts +++ b/packages/nutui/components/textarea/index.ts @@ -1 +1,2 @@ export * from './textarea' +export * from './type' diff --git a/packages/nutui/components/textarea/textarea.ts b/packages/nutui/components/textarea/textarea.ts index 25c6cd27..a366bc02 100644 --- a/packages/nutui/components/textarea/textarea.ts +++ b/packages/nutui/components/textarea/textarea.ts @@ -2,7 +2,7 @@ import type { ExtractPropTypes, PropType } from 'vue' import { commonProps, isString, makeNumberProp, makeStringProp, truthProp } from '../_utils' import { BLUR_EVENT, CHANGE_EVENT, CONFIRM_EVENT, FOCUS_EVENT, UPDATE_MODEL_EVENT } from '../_constants' import type { InputAlignType } from '../input' -import type { TextareaAdjustKeyboardTo, TextareaConfirmType } from './type' +import type { TextareaAdjustKeyboardTo, TextareaAutosizeObject, TextareaConfirmType } from './type' export const textareaProps = { ...commonProps, @@ -50,7 +50,7 @@ export const textareaProps = { * @description 是否自适应内容高度,也可传入对象 */ autosize: { - type: [Boolean, Object], + type: [Boolean, Object as PropType], default: false, }, /** diff --git a/packages/nutui/components/textarea/textarea.vue b/packages/nutui/components/textarea/textarea.vue index 86597115..b14eca39 100644 --- a/packages/nutui/components/textarea/textarea.vue +++ b/packages/nutui/components/textarea/textarea.vue @@ -1,4 +1,3 @@ -