File tree Expand file tree Collapse file tree 7 files changed +14
-7
lines changed
Expand file tree Collapse file tree 7 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ external-classes | Array | - | 组件类名,用于设置组件外层元素、
8888format | Function | - | 【开发中】指定输入框展示值的格式。TS 类型:` InputFormatType ` ` type InputFormatType = (value: InputValue) => number | string ` 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts ) | N
8989label | String / Slot | - | 左侧文本。 | N
9090maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。` maxcharacter ` 和 ` maxlength ` 二选一使用 | N
91- maxlength | Number | - | 用户最多可以输入的文本长度,一个中文等于一个计数长度。值为空,则表示不限制输入长度 。` maxcharacter ` 和 ` maxlength ` 二选一使用 | N
91+ maxlength | Number | -1 | 用户最多可以输入的文本长度,一个中文等于一个计数长度。默认为 -1,不限制输入长度 。` maxcharacter ` 和 ` maxlength ` 二选一使用 | N
9292placeholder | String | undefined | 占位符 | N
9393prefix-icon | String / Object / Slot | - | 组件前置图标。值为字符串表示图标名称,值为 ` Object ` 类型,表示透传至 ` icon ` 。 | N
9494readonly | Boolean | false | 【开发中】只读状态 | N
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ exports[`input props : clearable && label && suffix 1`] = `
4747 disabled = " {{false}}"
4848 focus = " {{false}}"
4949 holdKeyboard = " {{false}}"
50+ maxlength = " {{-1}}"
5051 password = " {{false}}"
5152 placeholder = " "
5253 placeholderClass = " t-input__placeholder input-placeholder"
@@ -69,7 +70,7 @@ exports[`input props : clearable && label && suffix 1`] = `
6970 />
7071 <wx-view
7172 class = " t-input__wrap--clearable-icon"
72- bind:tap ="clearInput"
73+ bind:touchstart ="clearInput"
7374 >
7475 <t-icon
7576 class = " "
@@ -179,6 +180,7 @@ exports[`input slots : label 1`] = `
179180 disabled = " {{false}}"
180181 focus = " {{false}}"
181182 holdKeyboard = " {{false}}"
183+ maxlength = " {{-1}}"
182184 password = " {{false}}"
183185 placeholder = " "
184186 placeholderClass = " t-input__placeholder input-placeholder"
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ exports[`input props : clearable && label && suffix 1`] = `
4747 disabled = " {{false}}"
4848 focus = " {{false}}"
4949 holdKeyboard = " {{false}}"
50+ maxlength = " {{-1}}"
5051 password = " {{false}}"
5152 placeholder = " "
5253 placeholderClass = " t-input__placeholder input-placeholder"
@@ -69,7 +70,7 @@ exports[`input props : clearable && label && suffix 1`] = `
6970 />
7071 <wx-view
7172 class = " t-input__wrap--clearable-icon"
72- bind:tap ="clearInput"
73+ bind:touchstart ="clearInput"
7374 >
7475 <t-icon
7576 class = " "
@@ -179,6 +180,7 @@ exports[`input slots : label 1`] = `
179180 disabled = " {{false}}"
180181 focus = " {{false}}"
181182 holdKeyboard = " {{false}}"
183+ maxlength = " {{-1}}"
182184 password = " {{false}}"
183185 placeholder = " "
184186 placeholderClass = " t-input__placeholder input-placeholder"
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ describe('input', () => {
190190 comp . attach ( document . createElement ( 'parent-wrapper' ) ) ;
191191
192192 const clearable = comp . querySelector ( '.base >>> .t-input__wrap--clearable-icon' ) ;
193- clearable . dispatchEvent ( 'tap ' ) ;
193+ clearable . dispatchEvent ( 'touchstart ' ) ;
194194 await simulate . sleep ( 0 ) ;
195195 expect ( handleClear . mock . calls [ 0 ] [ 0 ] . detail ) . toStrictEqual ( { } ) ;
196196 } ) ;
Original file line number Diff line number Diff line change 2626 <view class="{{classPrefix}}__wrap">
2727 <view class="{{classPrefix}}__content {{classPrefix}}--{{status}}">
2828 <input
29+ maxlength="{{maxlength}}"
2930 disabled="{{disabled}}"
3031 placeholder="{{placeholder}}"
3132 placeholder-style="{{placeholderStyle}}"
6869 <view
6970 wx:if="{{_clearIcon && value.length > 0}}"
7071 class="{{classPrefix}}__wrap--clearable-icon"
71- bind:tap ="clearInput"
72+ bind:touchstart ="clearInput"
7273 >
7374 <template
7475 is="icon"
Original file line number Diff line number Diff line change @@ -52,9 +52,10 @@ const props: TdInputProps = {
5252 maxcharacter : {
5353 type : Number ,
5454 } ,
55- /** 用户最多可以输入的文本长度,一个中文等于一个计数长度。值为空,则表示不限制输入长度 。`maxcharacter` 和 `maxlength` 二选一使用 */
55+ /** 用户最多可以输入的文本长度,一个中文等于一个计数长度,默认为 -1,不限制输入长度 。`maxcharacter` 和 `maxlength` 二选一使用 */
5656 maxlength : {
5757 type : Number ,
58+ value : - 1 ,
5859 } ,
5960 /** 占位符 */
6061 placeholder : {
Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ export interface TdInputProps {
9191 value ?: number ;
9292 } ;
9393 /**
94- * 用户最多可以输入的文本长度,一个中文等于一个计数长度。值小于等于 0 的时候,则表示不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用
94+ * 用户最多可以输入的文本长度,一个中文等于一个计数长度,默认为 -1,不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用
95+ * @default -1
9596 */
9697 maxlength ?: {
9798 type : NumberConstructor ;
You can’t perform that action at this time.
0 commit comments