Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(search): [search] Increase input maximum character limit attribu… #1457

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/sites/demos/apis/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/search/basic-usage.vue
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
5 changes: 3 additions & 2 deletions examples/sites/demos/pc/app/search/webdoc/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
},
Expand Down
15 changes: 15 additions & 0 deletions packages/vue/src/search/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading