feat(search): [search] Increase input maximum character limit attribute maxlength (#1457)

This commit is contained in:
chenxi-20 2024-03-05 17:43:16 +08:00 committed by GitHub
parent 74215437c3
commit 5f798de86b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 31 additions and 4 deletions

View File

@ -74,6 +74,17 @@ export default {
pcDemo: 'events',
mfDemo: ''
},
{
name: 'maxlength',
type: 'number',
defaultValue: '',
desc: {
'zh-CN': 'input 框的原生属性限制最大输入字符数【3.14.0新增】',
'en-US': 'The native properties of the input box limit the maximum number of input characters[New 3.14.0]'
},
mode: ['pc'],
pcDemo: 'basic-usage'
},
{
name: 'mini',
type: 'boolean',

View File

@ -1,6 +1,6 @@
<template>
<div>
<tiny-search v-model="value" placeholder="请输入关键词"></tiny-search>
<tiny-search v-model="value" placeholder="请输入关键词" :maxlength="10"></tiny-search>
<div class="mt10">当前搜索值为{{ value }}</div>
</div>
</template>

View File

@ -1,6 +1,6 @@
<template>
<div>
<tiny-search v-model="value" placeholder="请输入关键词"></tiny-search>
<tiny-search v-model="value" placeholder="请输入关键词" :maxlength="10"></tiny-search>
<div class="mt10">当前搜索值为{{ value }}</div>
</div>
</template>

View File

@ -9,9 +9,10 @@ export default {
'en-US': 'Basic Usage'
},
desc: {
'zh-CN': '通过 <code>v-model</code> 设置双向绑定搜索值, <code>placeholder</code> 设置默认占位符文本。',
'zh-CN':
'通过 <code>v-model</code> 设置双向绑定搜索值, <code>placeholder</code> 设置默认占位符文本, <code>input</code>元素的原生属性<code>maxlength</code> 设置输入框最大输入字符长度。',
'en-US':
'Set bidirectional binding search values through <code>v-model</code> , and set default placeholder text through <code>placeholder</code> .'
'Set bidirectional binding search values through <code>v-model</code> , and set default placeholder text through <code>placeholder</code> The native attribute of the <code>input</code> element<code>maxlength</code>sets the maximum input character length of the input box.'
},
codeFiles: ['basic-usage.vue']
},

View File

@ -36,6 +36,21 @@
</transition>
<input
ref="input"
v-bind="
a($attrs, [
'type',
'class',
'style',
'^on\w+',
'id',
'disabled',
'clearable',
'max',
'min',
'readonly',
'step'
])
"
v-model="state.currentValue"
:style="
transparent