File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change
1
+ function min(a,b){
2
+ return Math.min(a,b);
3
+ }
4
+
5
+ module.exports = {
6
+ min:min
7
+ }
Original file line number Diff line number Diff line change 1
- <!-- input/input.wxml -->
1
+ <wxs src="../core/wxs/math.wxs" module="Math" />
2
+
2
3
<label class='form-item {{disabled? "disabled": ""}}'>
3
4
<view class='default-border {{border? "border": ""}} l-class'>
4
5
<view class='mask' wx:if="{{disabled}}"></view>
21
22
bindblur="handleInputBlur"
22
23
bindconfirm="handleInputConfirm"
23
24
/>
24
- <view
25
- class="indicator"
26
- wx:if="{{indicator}}">{{value.length + '/' + maxlength}}</view>
25
+ <!-- 使用 Math.min 的原因:在安卓平台上,由于微信的 bug,value.length 会超过 maxlength,导致显示不准确 -->
26
+ <view class="indicator" wx:if="{{indicator}}">{{Math.min(value.length,maxlength) + '/' + maxlength}}</view>
27
27
</view>
28
28
</label>
29
29
<l-error-tip l-error-text-class="l-error-text l-error-text-class" errorText="{{errorText}}" wx:if="{{errorText}}"/>
You can’t perform that action at this time.
0 commit comments