Skip to content

Commit 43cf731

Browse files
committed
perf: 优化 current 的边界值判断
1 parent dd17a40 commit 43cf731

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/packages/__VUE/tour/index.taro.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export default create({
242242
() => props.modelValue,
243243
(visible) => {
244244
if (visible) {
245-
state.active = props.type === 'step' ? Math.min(props.current, props.steps.length - 1) : 0
245+
state.active = props.type === 'step' ? Math.min(Math.max(0, props.current), props.steps.length - 1) : 0
246246
getRootPosition()
247247
}
248248
state.showTour = visible

0 commit comments

Comments
 (0)