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;
}
然后
但是滚动不了,请问我应该怎么写呢?正在学习中,不是太懂,非常感谢
1:检查一下高度是否达到滚动高度?
2:给定一个非100%的高度,可以试试100vh?
3:实例化的时候时候在dom加载过后实例化