Skip to content

Commit

Permalink
fix: maxlength default -1
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Sep 3, 2024
1 parent 4595e0e commit 4b81937
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/textarea/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ hold-keyboard | Boolean | false | \- | N
indicator | Boolean | false | \- | N
label | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
maxcharacter | Number | - | \- | N
maxlength | String / Number | - | \- | N
maxlength | Number | -1 | \- | N
placeholder | String | undefined | \- | N
placeholder-style | String | - | \- | N
selection-end | Number | -1 | \- | N
Expand Down
2 changes: 1 addition & 1 deletion src/textarea/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ hold-keyboard | Boolean | false | focus时,点击页面的时候不收起键
indicator | Boolean | false | 显示文本计数器,如 0/140。当 `maxlength < 0 && maxcharacter < 0` 成立时, indicator无效 | N
label | String / Slot | - | 左侧文本。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度 | N
maxlength | String / Number | - | 用户最多可以输入的字符个数 | N
maxlength | Number | -1 | 用户最多可以输入的字符个数,值为 -1 的时候不限制最大长度 | N
placeholder | String | undefined | 占位符 | N
placeholder-style | String | - | 指定 placeholder 的样式,目前仅支持 color ,font-size和font-weight | N
selection-end | Number | -1 | 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 | N
Expand Down
5 changes: 3 additions & 2 deletions src/textarea/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ const props: TdTextareaProps = {
maxcharacter: {
type: Number,
},
/** 用户最多可以输入的字符个数 */
/** 用户最多可以输入的字符个数,值为 -1 的时候不限制最大长度 */
maxlength: {
type: null,
type: Number,
value: -1,
},
/** 占位符 */
placeholder: {
Expand Down
7 changes: 4 additions & 3 deletions src/textarea/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ export interface TdTextareaProps {
value?: number;
};
/**
* 用户最多可以输入的字符个数
* 用户最多可以输入的字符个数,值为 -1 的时候不限制最大长度
* @default -1
*/
maxlength?: {
type: null;
value?: string | number;
type: NumberConstructor;
value?: number;
};
/**
* 占位符
Expand Down

0 comments on commit 4b81937

Please sign in to comment.