forked from opentiny/tiny-vue
feat(search): [search] Increase input maximum character limit attribute maxlength (#1457)
This commit is contained in:
parent
74215437c3
commit
5f798de86b
|
@ -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',
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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']
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue