提交 5bc7e1b5 编写于 作者: U ustbhuangyi

using nextTick instead of setTimeout 20

上级 86c44973
......@@ -200,13 +200,14 @@
wheel.wheelTo(dist)
},
refresh() {
setTimeout(() => {
this.$nextTick(() => {
this.wheels.forEach((wheel) => {
wheel.refresh()
})
}, 200)
})
},
_createWheel(wheelWrapper, i) {
if (!this.wheels[i]) {
const wheel = this.wheels[i] = new BScroll(wheelWrapper.children[i], {
wheel: {
selectedIndex: this.pickerSelectedIndex[i] || 0
......@@ -215,7 +216,10 @@
wheel.on('scrollEnd', () => {
this.$emit(EVENT_CHANGE, i, wheel.getSelectedIndex())
})
return wheel
} else {
this.wheels[i].refresh()
}
return this.wheels[i]
},
_canConfirm() {
return this.wheels.every((wheel) => {
......
......@@ -127,9 +127,9 @@
this.pullDownInitTop = -50
},
mounted() {
setTimeout(() => {
this.$nextTick(() => {
this.initScroll()
}, 20)
})
},
methods: {
initScroll() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册