当前位置: 首页 > news >正文

四川建设企业网站永久免费手机建站平台

四川建设企业网站,永久免费手机建站平台,网页设计与制作教程书,大连学网站制作uniapp封装虚拟列表滚动组件 这里用到一个列表#xff0c;然后数据可能有很多很多…#xff0c;一次性全部渲染到dom上会卡顿#xff0c;很废性能#xff0c;于是用了这个虚拟列表就变丝滑很多很多。 组件mosoweInventedList 代码#xff1a; !-- 虚拟滚动列表组件然后数据可能有很多很多…一次性全部渲染到dom上会卡顿很废性能于是用了这个虚拟列表就变丝滑很多很多。 组件mosoweInventedList 代码 !-- 虚拟滚动列表组件mosoweInventedList -- templateview classmosowe-invented-listscroll-view classcontainer scroll-y :style{ height: boxHeight px } scrollhandleScrolldiv classmosowe-invented-wrap :style{ height: itemHeight * list.length px }div classmosowe-invented-content :style{ transform: translateY( offsetY px) }view classmosowe-invented-item v-for(item, index) in showList :keyindexslot :itemitem/slot/view/div/div/scroll-view/view /templatescriptexport default {props: {list: {type: Array,default: () []},cacheNum: {// 前后缓存数目type: Number,default: 10}},data() {return {showList: [], // 展示的数据列表boxHeight: 0, // 组件可视区高度itemHeight: 0, // 每条数据高度计算第一条数据的高度以第一条数据高度为主offsetY: 0};},computed: {pageNum() {if (this.boxHeight this.itemHeight) {return Math.ceil(this.boxHeight / this.itemHeight) this.cacheNum;} else {return this.cacheNum;}}},watch: {pageNum() {this.setShowList(0);},list: {handler() {this.init();},deep: true,immediate: true}},mounted() {this.init();},methods: {init() {this.$nextTick(() {this.setShowList(0);let t setTimeout(() {clearTimeout(t);t null;const query uni.createSelectorQuery().in(this);query.select(.mosowe-invented-list).boundingClientRect((res) {this.boxHeight Math.floor(res?.height) || 0;}).select(.mosowe-invented-item).boundingClientRect((res) {this.itemHeight Math.floor(res?.height) || 0;}).exec();}, 100);});},handleScroll(e) {const scrollTop Math.floor(e.detail.scrollTop);this.offsetY scrollTop - (scrollTop % this.itemHeight);let startIndex Math.floor(scrollTop / this.itemHeight);if (startIndex this.cacheNum) {this.offsetY - this.cacheNum * this.itemHeight;startIndex startIndex - this.cacheNum;}this.setShowList(startIndex);this.$emit(scroll, scrollTop);},setShowList(startIndex) {this.showList this.list.slice(startIndex, startIndex this.pageNum);}}}; /scriptstyle langscss scoped.mosowe-invented-list {overflow: hidden;height: 100%;width: 100%;.container {width: 100%;height: 100%;}} /style使用 templateview classcententmosoweInventedList :listlistData :cacheNum20template #default{ item }view classitemview classlistview classcol titleimage classmark src/static/images/layout/rectangle_9.png mode/image{{ item.yhmc }}/viewview classcol areau-count-to fontSize9rpx stylecolor: #2EC38E; classunm :endValitem.mjseparator,/u-count-totext classunitk㎡/text/viewview classcol time{{ item.jmrq }}/view/viewu-divider text/u-divider/view/template/mosoweInventedList/view /template
http://www.pierceye.com/news/40991/

相关文章:

  • f006网站建设wordpress如何设置关键词
  • 做一家仓储用地的网站广州哪里能建铝制自建房
  • 连云港规划建设网站asp网站怎么做404页面跳转
  • 容桂企业网站建设网络定制剧
  • asp.net 制作网站开发市场推广的方法
  • 电子商务网站建设与维护建网站的成本计算
  • 深圳网站建设费用大概多少免费咨询口腔科医生回答在线
  • 建设银行jo 办网站用卡每天网站外链做几条最好
  • 建设银行官方网站面试详细信息深圳做网站找哪家好
  • 在网站开发中进行用户管理安娜尔返利机器人怎么做网站
  • 网站活跃度怎么做免费注册网站
  • 哈尔滨营销型网站建设视觉设计的网站
  • 免费的企业建站系统网络营销课程免费
  • 帮别人做设计的网站wordpress登录网址
  • 做婚纱影楼网站的价格电子商务系统的组成
  • 网站建设的职称怎么自学做网站
  • 网站广告模板代码莱芜消息
  • 做淘宝客网站一定要备案吗招聘网有哪些网站比较好
  • 企业网站为什么打不开app开发公司应聘
  • 格尔木建设局网站九江建网站报价
  • 潍坊网站制作建设深圳有哪些公司名称
  • 山东兴华建设集团有限公司网站网络规划设计师百度网盘
  • 网站建设cach目录湛江企业建站系统
  • 网站编辑内容网站如何做广告
  • 怎么注销自己做的网站wordpress文章相册模式
  • 网站建设和客户面谈品牌网站建站公司
  • 中国建设工程招标官方网站江宁做网站价格
  • 怎样做网站镜像wordpress linux权限设置
  • 招聘平面设计南京seo按天计费
  • 图片拼接做网站背景专注于品牌营销服务