How to use better-scroll - 10 common examples

To help you get started, we’ve selected a few better-scroll examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wuhou123 / mui-vue2 / src / components / index / restaurant-detail / goods / goods.vue View on Github external
_initScroll () {
      this.menuScroll = new BScroll(this.$refs.menuRef, {
        click: true
      })
      this.foodsScroll = new BScroll(this.$refs.foodsRef, {
        click: true,
        probeType: 3
      })

      this.foodsScroll.on('scroll', pos => {
        this.scrollY = Math.abs(Math.floor(pos.y))
        // console.log(this.scrollY)
      })
    },
    // 计算右侧每一大项的高度
github Kim09AI / react-music / src / components / scroll / Scroll.jsx View on Github external
initScroll() {
        let { probeType, click, scrollX, listenScroll } = this.props

        this.scroll = new BScroll(this.wrapper, {
            probeType,
            click,
            scrollX,
            listenScroll
        })

        // 是否派发滚动到底部事件,用于上拉加载
        if (this.props.pullupFunc) {
            this.scroll.on('scrollEnd', () => {
                // 滚动到底部
                if (this.scroll.y <= this.scroll.maxScrollY + 50) {
                    this.props.pullupFunc()
                }
            })
        }
github Geek-James / ddBuy / src / views / category / components / CategoryContent.vue View on Github external
_initSubTitleScroll () {
      let contentWrapperWidth = 0;
      let el = this.$refs.subTitle;
      for (let i = 0; i < el.length; i++) {
        contentWrapperWidth += el[i].clientWidth;
      }
      // 给ul设置值
      this.$refs.ulContent.style.width = contentWrapperWidth + 'px';
      if (!this.scroll) {
        this.scroll = new BScroll('.subTitleWrapper', {
          startX: 0,
          click: true,
          scrollX: true,
          scrollY: false,
          eventPassthrough: "vertical",
        });
      } else {
        this.scroll.refresh();
      }
    },
    // 
github Neveryu / vue-cms / src / views / echarts / index-child / detail-label.vue View on Github external
_initScroll() {
      if(!this.scroll) {
        this.scroll = new BScroll(this.$refs.labelWrapper, {
          scrollX: true,
          click: true
        })
      } else {
        this.scroll.refresh()
      }
    },
    // 计算所有的 label 的宽度和
github Geek-James / ddBuy / src / views / order / Order.vue View on Github external
_initScroll () {
      if (!this.productImageScroll) {
        this.$refs.imageWrapper.style.width = (this.$refs.subWrapper.length * 60) + 'px';
        this.productImageScroll = new BScroll(this.$refs.productImageWrapper, {
          probeType: 3,
          startX: 0,
          click: true,
          scrollX: true,
        });
      } else {
        this.productImageScroll.refresh();
      }
    },
    // 2.返回到上个界面
github BingBlog / vue-hotel / src / page / index / children / City.vue View on Github external
this.$nextTick(() => {
            this.scrollCityBody = new BScroll(this.$refs.cityBody, {
              probeType: 3,
              click: true
            })
            console.log('aa')
            this.scrollCityBody.on('scroll', (pos) => {
              console.log(pos.x + '~' + pos.y)
            })
            this.scrollCityBody.scrollTo(0, 0)
          })
        } else {
github Fyerl / vue-awesome-picker / src / lib / vue-awesome-picker.vue View on Github external
createWheel (wheelWrapper, i) {
      if (!this.wheels[i]) {
        const wheel = this.wheels[i] = new BScroll(wheelWrapper.children[i], {
          wheel: {
            selectedIndex: 0,
            rotate: 25
          },
          bounceTime: 500,
          swipeTime: 1800
        })
        wheel.on('scrollEnd', () => {
          this.cascadePickerChange(i)
        })
      } else {
        this.wheels[i].refresh()
      }
      return this.wheels[i]
    },
github Rekoe / nutz-dingtalk / ui / src / main / resources / src / components / goods / Goods.vue View on Github external
initScroll() {
        this.menuScroll = new BScroll(this.$refs.menuScroll, {
          click: true
        })
        this.foodScroll = new BScroll(this.$refs.foodScroll, {
          probeType: 3,
          click: true
        })
        //foodScroll监听事件
        this.foodScroll.on("scroll", (pos) => {
          this.scrollY = Math.abs(pos.y)
        })

      },
      calculateHeight() {
github yrq1429 / yrq_js_fullstack / vue / vue-eleme-app / src / components / seller / seller.vue View on Github external
_initScroll() {
        if (!this.scroll) {
          this.scroll = new BScroll(this.$refs.seller, {
            click: true
          });
        } else {
          this.scroll.refresh();
        }
      },
      _initPics() {
github ytxbnahn / React-element / src / Component / food / food.js View on Github external
componentDidMount() {
        this.setState({
            showFlag : true,
            selectType : ALL,
            onlyContent : true
        })
        if (!this.scroll) {
            this.scroll = new BScroll(this.refs.food, {
                click: true
            });
        } else {
        this.scroll.refresh();
        }
    }
    hide() {

better-scroll

Full-featured BetterScroll

MIT
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Popular better-scroll functions