鍍金池/ 問答/HTML/ vue引入better-scroll無法滾動

vue引入better-scroll無法滾動

vue2 引入better-scroll,實例化:

const wrapper = document.querySelector('.wrapper')
const scroll = new BScroll('.wrapper',{
  click:true
})

<template>
<div class="singer">

<div class="wrapper">
  <div class="content">
     <ul>
        <li v-for="item in singerList"></li>
     </ul>
  </div>
</div>

</div>
</template>

.singer {
position: fixed;
width: 100%;
top: 60px;
bottom: 0;
}
.wrapper {
height: 100%;
overflow: hidden;
}

然后
clipboard.png
但是滾動不了,請問我應(yīng)該怎么寫呢?正在學習中,不是太懂,非常感謝

回答
編輯回答
心癌

1:檢查一下高度是否達到滾動高度?
2:給定一個非100%的高度,可以試試100vh?
3:實例化的時候時候在dom加載過后實例化

2017年11月6日 21:04
編輯回答
負我心

加載順的問題,我不知道往那些,就想起了周期函數(shù),我把獲取數(shù)據(jù)的寫在mounted里面 把這個插件的初始化寫在updated里面,就可以滾動了,非常感謝

2017年6月24日 14:58