We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我通过如下方式,虽然实现了左右联动,但是不知道为什么反应特别的慢,请问您知道原因吗
methods: { scroll (e) { let scrollTop = e.mp.detail.scrollTop this.currentY = Math.abs(Math.round(scrollTop)) } }, computed: { currentIndex () { for (let i = 0; i < this.foodListHeights.length - 1; i++) { let heightBottom = this.foodListHeights[i] let heightTop = this.foodListHeights[i + 1] // 对滑动后currentY值不足的情况进行修正 let diff = Math.abs(this.currentY - heightTop) if (diff < 5) { this.currentY = heightTop } // 判断currentY当前所在的区间 if (this.currentY < heightTop && this.currentY >= heightBottom) { return i } } } }
The text was updated successfully, but these errors were encountered:
我也碰到了,安卓下反应很慢,ios下好点,还没解决
Sorry, something went wrong.
我也碰到这个问题,找不到原因。 //右边内容区域滚动 onScroll(e) { this.contentId = ""; let scrollTop = e.target.scrollTop; let domListHeight = this.listHeight; if (scrollTop >= domListHeight[domListHeight.length - 1] - this.contentHeight) { return; } else if(scrollTop > 0 && scrollTop < domListHeight[0]){ this.currentIndex = 0; } for (let i = 0; i < domListHeight.length; i++) { if(scrollTop >= domListHeight[i - 1] && scrollTop < domListHeight[i]) { this.currentIndex = i; } } },
No branches or pull requests
我通过如下方式,虽然实现了左右联动,但是不知道为什么反应特别的慢,请问您知道原因吗
methods: {
scroll (e) {
let scrollTop = e.mp.detail.scrollTop
this.currentY = Math.abs(Math.round(scrollTop))
}
},
computed: {
currentIndex () {
for (let i = 0; i < this.foodListHeights.length - 1; i++) {
let heightBottom = this.foodListHeights[i]
let heightTop = this.foodListHeights[i + 1]
// 对滑动后currentY值不足的情况进行修正
let diff = Math.abs(this.currentY - heightTop)
if (diff < 5) {
this.currentY = heightTop
}
// 判断currentY当前所在的区间
if (this.currentY < heightTop && this.currentY >= heightBottom) {
return i
}
}
}
}
The text was updated successfully, but these errors were encountered: