<template>
<div ref="box" class="box">
<div class="content">
<p v-for="(item,i) in Array(60)" :key='i'>内容</p>
</div>
</div>
</template>
<style scoped>
.box{
position: fixed;
width: 100%;
/* height: 100%; */
bottom: 0;
top: 100px;
overflow: hidden;
}
.content{
border: 1px solid #000;
padding: 20px;
}
.content p {
/* height: 100px; */
border-bottom: 1px solid #000;
}
</style>
<script>
import BScroll from '@better-scroll/core'
export default {
data () {
return {
}
},
mounted () {
this.$nextTick(() => {
this._initScroll()
})
},
methods: {
_initScroll () {
this.scroll = new BScroll('.box', {
scrollY: true
})
}
}
}
</script>
better-scroll纵向滚动
最新推荐文章于 2022-07-15 09:45:43 发布