find a mobile horizontal paging component. If you want to drag and drop paging, you"d better support vue
I used better-scroll, which also supports horizontal dragging, but it doesn"t seem to have events like pullingUp in the vertical state, so I can"t perfectly listen for list moving to the end.
then I want to listen to scroll, but can"t listen to this event. Is it my mistake or is the plug-in updated?
so in the end, scrollEnd, is used, but the problem with this event is that it is only triggered after scrolling stops, so before scrolling stops, scrolling again will cause the newly acquired data to be rendered and put into dom, and finally the refresh method will be called, and the better-scroll component will not be aware of it. The result is that the newly acquired data is always outside the screen, asking the old driver to lead the way
this.scroll = new BScroll(this.$refs.wrapper, {
click: true,
scrollX: true
})
const maxScrollX = this.scroll.maxScrollX
this.scroll.on("scrollEnd", (pos) => {
if (pos.x < maxScrollX + 50 && this.brandList.length < this.total){
console.log(this.$refs.list, "list ref")
this.$emit("loadMore", "brand")
this.scroll.refresh()
}
})