Answer the question
In order to leave comments, you need to log in
Why doesn't nextTick work?
Tell me why nextTick does not work, I move the scroll, but in alert it gives a value before moving
prevBanner () {
const $scroll = this.$refs.bannerScroll.scrollLeft
this.$refs.bannerScroll.scrollTo({
left: $scroll - 750,
behavior: 'smooth'
})
this.$nextTick(() => {
if (this.$refs.bannerScroll.scrollLeft === 0) {
this.isVisiblePrev = false
}
alert(this.$refs.bannerScroll.scrollLeft)
this.isVisibleNext = true
})
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question