diff --git a/src/input/input.en-US.md b/src/input/input.en-US.md index 068b004bf..327c8b7d1 100644 --- a/src/input/input.en-US.md +++ b/src/input/input.en-US.md @@ -27,7 +27,7 @@ showClearIconOnEmpty | Boolean | false | show clear icon on empty input value | showLimitNumber | Boolean | false | show limit number text on the right | N size | String | medium | make input to be different size。options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N spellCheck | Boolean | false | attribute of input element, [see here](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/spellcheck) | N -status | String | undefined | options: default/success/warning/error | N +status | String | default | options: default/success/warning/error | N suffix | String / Slot / Function | - | suffix content before suffixIcon。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N suffixIcon | Slot / Function | - | suffix icon of input。Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N tips | String / Slot / Function | - | tips on the bottom of input, different `status` can make tips to be different color。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N diff --git a/src/input/input.md b/src/input/input.md index c86793f93..64c0e0bb6 100644 --- a/src/input/input.md +++ b/src/input/input.md @@ -27,7 +27,7 @@ showClearIconOnEmpty | Boolean | false | 输入框内容为空时,悬浮状态 showLimitNumber | Boolean | false | 是否在输入框右侧显示字数统计 | N size | String | medium | 输入框尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N spellCheck | Boolean | false | 是否开启拼写检查,HTML5 原生属性,[点击查看详情](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/spellcheck) | N -status | String | undefined | 输入框状态。默认情况会由组件内部根据实际情况呈现,如果文本过长引起的状态变化。可选项:default/success/warning/error | N +status | String | default | 输入框状态。可选项:default/success/warning/error | N suffix | String / Slot / Function | - | 后置图标前的后置内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N suffixIcon | Slot / Function | - | 组件后置图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N tips | String / Slot / Function | - | 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N diff --git a/src/input/props.ts b/src/input/props.ts index 700b5edcd..c2a7793ba 100644 --- a/src/input/props.ts +++ b/src/input/props.ts @@ -91,10 +91,10 @@ export default { }, /** 是否开启拼写检查,HTML5 原生属性,[点击查看详情](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/spellcheck) */ spellCheck: Boolean, - /** 输入框状态。默认情况会由组件内部根据实际情况呈现,如果文本过长引起的状态变化 */ + /** 输入框状态 */ status: { type: String as PropType, - default: undefined as TdInputProps['status'], + default: 'default' as TdInputProps['status'], validator(val: TdInputProps['status']): boolean { if (!val) return true; return ['default', 'success', 'warning', 'error'].includes(val); @@ -124,6 +124,7 @@ export default { /** 输入框的值 */ value: { type: [String, Number] as PropType, + default: undefined, }, /** 输入框的值,非受控属性 */ defaultValue: { diff --git a/src/input/type.ts b/src/input/type.ts index f2ef9bae0..a8c96866b 100644 --- a/src/input/type.ts +++ b/src/input/type.ts @@ -103,7 +103,8 @@ export interface TdInputProps { */ spellCheck?: boolean; /** - * 输入框状态。默认情况会由组件内部根据实际情况呈现,如果文本过长引起的状态变化 + * 输入框状态 + * @default default */ status?: 'default' | 'success' | 'warning' | 'error'; /**