提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
前言
利用nvue的list 实现类似抖音直播 并且可以实现 向上 向下 滑动 均可加载数据
一、使用的nvue 组件
使用 nvue 的 list 组件 + cell组件实现
二、使用步骤
1.新建nvue 页面 添加列表实现全屏的上下滑动功能
新建nvue 页面 给最外层view 盒子 添加 flex: 1;
这是 能够全屏上下滑动的关键所在
<view class="container">
<list class="liveListBox" :scrollTop = "liveScrollTop" @scroll="listScroll" :loadmoreoffset="wHeight" :show-scrollbar="false" :bounce="true" ref="listBox" :pagingEnabled="true" :scrollable="LiveScrollable">
<cell v-for="(item,index) in liveList" :key="index">
<div ref="item" class="item" :style="boxStyle">
<!-- <view>{
{item.id}}</view> -->
<!-- <video :src="item.url" :style="{width: '750rpx',height: windowHeight + 'px'}" :autoplay="false"
></video> -->
<jVideo v-if="Math.abs(nowKey - index)<=1" @changeIsLoad="changeIsLoad" :id=