Skip to content
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
4 changes: 4 additions & 0 deletions packages/stepper/demo/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<van-stepper value="{{ 1 }}" min="5" max="8" />
</van-cell>

<van-cell center title="字符串类型的范围">
<van-stepper value="{{ 8 }}" min="2" max="10" />
</van-cell>

<van-cell center title="限制输入整数">
<van-stepper value="{{ 1 }}" integer />
</van-cell>
Expand Down
4 changes: 2 additions & 2 deletions packages/stepper/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
wx:if="{{ showMinus }}"
data-type="minus"
style="{{ computed.buttonStyle({ buttonSize }) }}"
class="minus-class {{ utils.bem('stepper__minus', { disabled: disabled || disableMinus || currentValue <= min }) }}"
class="minus-class {{ utils.bem('stepper__minus', { disabled: disabled || disableMinus || currentValue * 1 <= min * 1 }) }}"
hover-class="van-stepper__minus--hover"
hover-stay-time="70"
bind:tap="onTap"
Expand All @@ -31,7 +31,7 @@
wx:if="{{ showPlus }}"
data-type="plus"
style="{{ computed.buttonStyle({ buttonSize }) }}"
class="plus-class {{ utils.bem('stepper__plus', { disabled: disabled || disablePlus || currentValue >= max }) }}"
class="plus-class {{ utils.bem('stepper__plus', { disabled: disabled || disablePlus || currentValue * 1 >= max * 1 }) }}"
hover-class="van-stepper__plus--hover"
hover-stay-time="70"
bind:tap="onTap"
Expand Down
58 changes: 58 additions & 0 deletions packages/stepper/test/__snapshots__/demo.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,64 @@ exports[`should render demo and match snapshot 1`] = `
</wx-view>
</wx-view>
</van-cell>
<van-cell>
<wx-view
class="custom-class van-cell van-cell--center"
hoverClass="van-cell--hover hover-class"
hoverStayTime="70"
style=""
bind:tap="onClick"
>
<wx-view
class="van-cell__title title-class"
style=""
>
字符串类型的范围
</wx-view>
<wx-view
class="van-cell__value value-class"
>
<van-stepper>
<wx-view
class="van-stepper custom-class"
>
<wx-view
class="minus-class van-stepper__minus"
data-type="minus"
hoverClass="van-stepper__minus--hover"
hoverStayTime="70"
style=""
bind:tap="onTap"
bind:touchend="onTouchEnd"
bind:touchstart="onTouchStart"
/>
<wx-input
alwaysEmbed="{{false}}"
class="input-class van-stepper__input"
disabled="{{false}}"
focus=""
style=""
type="digit"
value="8"
bind:blur="onBlur"
bind:focus="onFocus"
bind:input="onInput"
/>
<wx-view
class="plus-class van-stepper__plus"
data-type="plus"
hoverClass="van-stepper__plus--hover"
hoverStayTime="70"
style=""
bind:tap="onTap"
bind:touchend="onTouchEnd"
bind:touchstart="onTouchStart"
/>
</wx-view>
</van-stepper>
</wx-view>
</wx-view>
</van-cell>
<van-cell>
<wx-view
class="custom-class van-cell van-cell--center"
Expand Down
Loading