From 042e0101c16340eb171be00ac173a3dbc03dcde1 Mon Sep 17 00:00:00 2001 From: betavs <34408516+betavs@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:11:57 +0800 Subject: [PATCH] docs(textarea): update the default value of confirm-type props (#2475) --- src/textarea/README.en-US.md | 23 ++++++++++++----------- src/textarea/README.md | 27 +++++++++++++++------------ src/textarea/type.ts | 2 +- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/textarea/README.en-US.md b/src/textarea/README.en-US.md index 0e5c74fa5..f17589a26 100644 --- a/src/textarea/README.en-US.md +++ b/src/textarea/README.en-US.md @@ -1,6 +1,7 @@ :: BASE_DOC :: ## API + ### Textarea Props name | type | default | description | required @@ -9,7 +10,7 @@ adjust-position | Boolean | true | \- | N autofocus | Boolean | false | \- | N autosize | Boolean | false | \- | N confirm-hold | Boolean | false | \- | N -confirm-type | String | done | options:send/search/next/go/done。Typescript:`'send' \| 'search' \| 'next' \| 'go' \| 'done'` | N +confirm-type | String | return | options:return/send/search/next/go/done。Typescript:`'return' \| 'send' \| 'search' \| 'next' \| 'go' \| 'done'` | N cursor-spacing | Number | 0 | \- | N disabled | Boolean | false | \- | N external-classes | Array | - | `['t-class', 't-class-textarea', 't-class-label']` | N @@ -31,16 +32,16 @@ enter | `(value: TextareaValue)` | \- focus | `(value: TextareaValue)` | \- line-change | `(value: TextareaValue)` | \- - ### CSS Variables + The component provides the following CSS variables, which can be used to customize styles. -Name | Default Value | Description +Name | Default Value | Description -- | -- | -- ---td-textarea-background-color | @bg-color-container | - ---td-textarea-border-color | rgba(220, 220, 220, 1) | - ---td-textarea-border-radius | @radius-default | - ---td-textarea-disabled-text-color | @font-gray-4 | - ---td-textarea-indicator-text-color | @font-gray-3 | - ---td-textarea-label-color | @font-gray-1 | - ---td-textarea-placeholder-color | @font-gray-3 | - ---td-textarea-text-color | @font-gray-1 | - +--td-textarea-background-color | @bg-color-container | - +--td-textarea-border-color | rgba(220, 220, 220, 1) | - +--td-textarea-border-radius | @radius-default | - +--td-textarea-disabled-text-color | @font-gray-4 | - +--td-textarea-indicator-text-color | @font-gray-3 | - +--td-textarea-label-color | @font-gray-1 | - +--td-textarea-placeholder-color | @font-gray-3 | - +--td-textarea-text-color | @font-gray-1 | - diff --git a/src/textarea/README.md b/src/textarea/README.md index ca4efa8ed..0e00bf738 100644 --- a/src/textarea/README.md +++ b/src/textarea/README.md @@ -6,6 +6,7 @@ isComponent: true --- + ## 引入 全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。 @@ -57,6 +58,7 @@ isComponent: true - 如果需要在页面中调整 `textarea` 中 `placeholder` 样式,请使用名称为`t-textarea__placeholder`的Class选择器,直接覆盖组件内部样式(注意权重)。 ## API + ### Textarea Props 名称 | 类型 | 默认值 | 说明 | 必传 @@ -65,7 +67,7 @@ adjust-position | Boolean | true | 键盘弹起时,是否自动上推页面 | autofocus | Boolean | false | 自动聚焦,拉起键盘 | N autosize | Boolean / Object | false | 是否自动增高,值为 true 时,style.height 不生效。支持传入对象,如 { maxHeight: 120, minHeight: 20 } | N confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起点 | N -confirm-type | String | done | 设置键盘右下角按钮的文字,仅在 type='text'时生效。可选项:send/search/next/go/done。TS 类型:`'return' \| 'send' \| 'search' \| 'next' \| 'go' \| 'done'` | N +confirm-type | String | return | 设置键盘右下角按钮的文字,仅在 type='text'时生效。可选项:return/send/search/next/go/done。TS 类型:`'return' \| 'send' \| 'search' \| 'next' \| 'go' \| 'done'` | N cursor-spacing | Number | 0 | 指定光标与键盘的距离。取textarea距离底部的距离和cursor-spacing指定的距离的最小值作为光标与键盘的距离 | N disabled | Boolean | false | 是否禁用文本框 | N focus | Boolean | false | 自动聚焦 | N @@ -98,23 +100,24 @@ line-change | `(value: TextareaValue)` | 行高发生变化时触发 keyboardheightchange | `(height: number, duration: number)` | 键盘高度发生变化的时候触发此事件 ### Textarea 外部样式类 + 类名 | 说明 --- | -- +-- | -- t-class | 根节点样式类 t-class-textarea | 占位符样式类 t-class-label | 左侧文本样式类 t-class-indicator | 计数器样式类 - ### CSS 变量 + 组件提供了下列 CSS 变量,可用于自定义样式。 -名称 | 默认值 | 描述 +名称 | 默认值 | 描述 -- | -- | -- ---td-textarea-background-color | @bg-color-container | - ---td-textarea-border-color | rgba(220, 220, 220, 1) | - ---td-textarea-border-radius | @radius-default | - ---td-textarea-disabled-text-color | @font-gray-4 | - ---td-textarea-indicator-text-color | @font-gray-3 | - ---td-textarea-label-color | @font-gray-1 | - ---td-textarea-placeholder-color | @font-gray-3 | - ---td-textarea-text-color | @font-gray-1 | - +--td-textarea-background-color | @bg-color-container | - +--td-textarea-border-color | rgba(220, 220, 220, 1) | - +--td-textarea-border-radius | @radius-default | - +--td-textarea-disabled-text-color | @font-gray-4 | - +--td-textarea-indicator-text-color | @font-gray-3 | - +--td-textarea-label-color | @font-gray-1 | - +--td-textarea-placeholder-color | @font-gray-3 | - +--td-textarea-text-color | @font-gray-1 | - diff --git a/src/textarea/type.ts b/src/textarea/type.ts index 0e14bba74..4e2c6457d 100644 --- a/src/textarea/type.ts +++ b/src/textarea/type.ts @@ -39,7 +39,7 @@ export interface TdTextareaProps { }; /** * 设置键盘右下角按钮的文字,仅在 type='text'时生效 - * @default done + * @default return */ confirmType?: { type: StringConstructor;