Skip to content

Commit

Permalink
fix(input): fix status default value (#4530)
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 authored Sep 4, 2024
1 parent a4b9e3a commit f374947
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/input/input.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-next/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-next/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-next/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-next/blob/develop/src/common.ts) | N
Expand Down
4 changes: 2 additions & 2 deletions src/input/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ allowInputOverMax | Boolean | false | 超出 `maxlength` 或 `maxcharacter` 之
autoWidth | Boolean | false | 宽度随内容自适应 | N
autocomplete | String | undefined | 是否开启自动填充功能,HTML5 原生属性,[点击查看详情](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) | N
autofocus | Boolean | false | 自动聚焦 | N
borderless | Boolean | false | 无边框模式 | N
borderless | Boolean | false | 是否开启无边框模式 | N
clearable | Boolean | false | 是否可清空 | N
disabled | Boolean | undefined | 是否禁用输入框 | N
format | Function | - | 指定输入框展示值的格式。注意 `type=number` 时请勿使用,此功能建议更为使用 `InputNumber` 组件。TS 类型:`InputFormatType` `type InputFormatType = (value: string) => string`[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/input/type.ts) | N
Expand All @@ -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-next/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-next/blob/develop/src/common.ts) | N
suffixIcon | Slot / Function | - | 组件后置图标。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
tips | String / Slot / Function | - | 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
Expand Down
6 changes: 3 additions & 3 deletions src/input/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default {
},
/** 自动聚焦 */
autofocus: Boolean,
/** 无边框模式 */
/** 是否开启无边框模式 */
borderless: Boolean,
/** 是否可清空 */
clearable: Boolean,
Expand Down Expand Up @@ -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<TdInputProps['status']>,
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);
Expand Down
5 changes: 3 additions & 2 deletions src/input/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface TdInputProps<T = InputValue> {
*/
autofocus?: boolean;
/**
* 无边框模式
* 是否开启无边框模式
* @default false
*/
borderless?: boolean;
Expand Down Expand Up @@ -103,7 +103,8 @@ export interface TdInputProps<T = InputValue> {
*/
spellCheck?: boolean;
/**
* 输入框状态。默认情况会由组件内部根据实际情况呈现,如果文本过长引起的状态变化
* 输入框状态
* @default default
*/
status?: 'default' | 'success' | 'warning' | 'error';
/**
Expand Down

0 comments on commit f374947

Please sign in to comment.