chore: fui-search-bar 增加最大位数限制

This commit is contained in:
Hefeng
2023-08-28 13:29:54 +08:00
parent 92b6e7ce0b
commit 0602515832

View File

@ -12,7 +12,7 @@
<view class="fui-sbi__circle"></view> <view class="fui-sbi__circle"></view>
<view class="fui-sbi__line"></view> <view class="fui-sbi__line"></view>
</view> </view>
<input ref="searchBarRef" class="fui-search__bar-input" :class="{'fui-sb__input-color':!color}" <input ref="searchBarRef" :maxlength="maxlength" class="fui-search__bar-input" :class="{'fui-sb__input-color':!color}"
:style="{color:color,height: height+'rpx'}" placeholder-class="fui-search__bar-pl" :style="{color:color,height: height+'rpx'}" placeholder-class="fui-search__bar-pl"
:placeholder="plholder" :value="val" :focus="isFocus" :disabled="disabled" confirm-type="search" :placeholder="plholder" :value="val" :focus="isFocus" :disabled="disabled" confirm-type="search"
@blur="inputBlur" @focus="inputFocus" @input="inputChange" @confirm="search" /> @blur="inputBlur" @focus="inputFocus" @input="inputChange" @confirm="search" />
@ -52,10 +52,10 @@
background: { background: {
type: String, type: String,
// #ifdef APP-NVUE // #ifdef APP-NVUE
default: '#F1F4FA' default: '#F1F4FA',
// #endif // #endif
// #ifndef APP-NVUE // #ifndef APP-NVUE
default: '' default: '',
// #endif // #endif
}, },
//搜索栏上下paddingpadding-toppadding-bottom //搜索栏上下paddingpadding-toppadding-bottom
@ -143,7 +143,11 @@
fixed: { fixed: {
type: Boolean, type: Boolean,
default: false default: false
} },
maxlength: {
type: [Number, String],
default: 30
},
}, },
created() { created() {
this.val = this.value; this.val = this.value;