File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
uni_modules/wot-design-uni/components/wd-input Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ function handleChange(event) {
120120| v-model | 绑定值 | string / number | - | - | - |
121121| placeholder | 占位文本 | string | - | 请输入... | - |
122122| clearable | 显示清空按钮 | boolean | - | false | - |
123- | maxlength | 原生属性,最大长度 | string | - | - | - |
123+ | maxlength | 原生属性,最大长度 | number | - | 支付宝小程序无默认值,其余平台默认为-1 | - |
124124| showPassword | 显示为密码框 | boolean | - | false | - |
125125| disabled | 原生属性,禁用 | boolean | - | false | - |
126126| readonly | 只读 | boolean | - | false | - |
Original file line number Diff line number Diff line change 1818 <demo-block title =" 密码框" >
1919 <wd-input type =" text" v-model =" value5" disabled clearable show-password @change =" handleChange2" />
2020 </demo-block >
21+ <demo-block title =" 数字类型" >
22+ <wd-input type =" number" v-model =" value9" />
23+ </demo-block >
2124 <demo-block title =" 设置前后Icon" >
2225 <wd-input type =" text" v-model =" value6" prefix-icon =" dong" suffix-icon =" list" clearable @change =" handleChange3" />
2326 </demo-block >
@@ -58,9 +61,7 @@ const value5 = ref<string>('password')
5861const value6 = ref <string >(' ' )
5962const value7 = ref <string >(' 1234' )
6063const value8 = ref <string >(' ' )
61- const value9 = ref <string >(' ' )
62- const value10 = ref <string >(' 支持清空和字数限制的文本域' )
63- const value11 = ref <string >(' 输入文字后,输入框高度跟随字数多少变化' )
64+ const value9 = ref <number | null >(null )
6465const value12 = ref <string >(' ' )
6566const value13 = ref <string >(' 该输入框禁用' )
6667const value14 = ref <string >(' 12345678' )
Original file line number Diff line number Diff line change @@ -61,7 +61,12 @@ export const inputProps = {
6161 /**
6262 * 原生属性,最大长度
6363 */
64- maxlength : makeNumberProp ( - 1 ) ,
64+ maxlength : {
65+ type : Number ,
66+ // #ifndef MP-ALIPAY
67+ default : - 1
68+ // #endif
69+ } ,
6570 /**
6671 * 原生属性,禁用
6772 */
Original file line number Diff line number Diff line change 5757 <text
5858 :class =" [
5959 inputValue && String(inputValue).length > 0 ? 'wd-input__count-current' : '',
60- String(inputValue).length > maxlength ? 'is-error' : ''
60+ String(inputValue).length > maxlength! ? 'is-error' : ''
6161 ]"
6262 >
6363 {{ String(inputValue).length }}
You can’t perform that action at this time.
0 commit comments