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

做网站买阿里云的ecs服务器网站模板库

做网站买阿里云的ecs服务器,网站模板库,领航 网站设计,企业网络营销策略有哪些万级数据前端渲染优化 解决思路requestAnimationFrame完整代码 解决思路 将数据分组,通过定时器或requestAnimationFrame两种方式分组渲染到Dom上 requestAnimationFrame 渲染数据-动画requestAnimationFram方法 使用requestAnimationFrame可以将动画的每一帧绘制…

万级数据前端渲染优化

  • 解决思路
  • requestAnimationFrame
      • 完整代码

解决思路

将数据分组,通过定时器或requestAnimationFrame两种方式分组渲染到Dom上

requestAnimationFrame

渲染数据-动画requestAnimationFram方法
使用requestAnimationFrame可以将动画的每一帧绘制操作封装为一个回调函数,
并将这个回调函数传递给requestAnimationFrame函数。
当浏览器准备进行下一帧绘制时,会自动调用这个回调函数,从而实现了动画的循环。

// 定义一个渲染函数
const useTwoArr=(page)=>{if(page>twoArr.length-1) return// 用动画讲求来优化requestAnimationFrame(()=>{// 取一项,拼接一项this.tableData=[...this.tableData,...twoArr[page]]console.log(page)// 下一项page++// 递归调用useTwoArr(page)})}useTwoArr(0)

完整代码

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title></title><!-- 引入vue --><script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script><!-- elementui引入样式 --><link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"><!--elementui 引入组件库 --><script src="https://unpkg.com/element-ui/lib/index.js"></script><!-- axios --><script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script></head><body><div id="app"><el-tablev-loading="loading":data="tableData"height="500"style="width: 500px"><el-table-columnprop="id"label="学号"width="180"></el-table-column><el-table-columnprop="name"label="姓名"width="180"></el-table-column><el-table-columnprop="value"label="座号"></el-table-column></el-table></div><script>// 创建一个Vue实例new Vue({el: '#app',data() {return {loading: true,tableData:[],apiData:[],}},mounted() {this.getGroudData()},methods:{async getGroudData(){// this.loading=trueconst res=await axios.get('http://124.223.69.156:3300/bigData')// console.log(res)if(res.data.code===0){this.loading=falsethis.apiData=res.data.data// console.log(this.apiData)// top10// this.tableData=this.apiData.slice(0,10)// 分组let twoArr=this.buildTablePreTen(this.apiData)console.log(twoArr)// 渲染数据-定时器方法:/* twoArr.forEach((item,index)=>{setTimeout(()=>{this.tableData=[...this.tableData,...item]},20*index)console.log(index)}) *//*渲染数据-动画requestAnimationFram方法使用requestAnimationFrame可以将动画的每一帧绘制操作封装为一个回调函数,并将这个回调函数传递给requestAnimationFrame函数。当浏览器准备进行下一帧绘制时,会自动调用这个回调函数,从而实现了动画的循环。 */// 定义一个渲染函数const useTwoArr=(page)=>{if(page>twoArr.length-1) return// 用动画讲求来优化requestAnimationFrame(()=>{// 取一项,拼接一项this.tableData=[...this.tableData,...twoArr[page]]console.log(page)// 下一项page++// 递归调用useTwoArr(page)})}useTwoArr(0)}},/*分组构造数据每组10条10万条分原1万组*/buildTablePreTen(arr){let i=0let res=[]// 1万条数据渲染while(i<10000){res.push(arr.slice(i,i+10))i=i+10}return res}}});</script> </body>
</html>

文章转载自:
http://gaijin.fwrr.cn
http://goethean.fwrr.cn
http://inobservant.fwrr.cn
http://trey.fwrr.cn
http://horrify.fwrr.cn
http://nepotistical.fwrr.cn
http://alexandrine.fwrr.cn
http://anymore.fwrr.cn
http://unipolar.fwrr.cn
http://phonematic.fwrr.cn
http://harz.fwrr.cn
http://flocky.fwrr.cn
http://elaborately.fwrr.cn
http://abiding.fwrr.cn
http://daftly.fwrr.cn
http://upriver.fwrr.cn
http://receptiblity.fwrr.cn
http://evert.fwrr.cn
http://goatherd.fwrr.cn
http://violate.fwrr.cn
http://platysma.fwrr.cn
http://polymerizing.fwrr.cn
http://foolish.fwrr.cn
http://softwood.fwrr.cn
http://transmogrification.fwrr.cn
http://reside.fwrr.cn
http://astrocytoma.fwrr.cn
http://animadversion.fwrr.cn
http://jilin.fwrr.cn
http://rubrication.fwrr.cn
http://insufficience.fwrr.cn
http://sculpsit.fwrr.cn
http://masticator.fwrr.cn
http://effector.fwrr.cn
http://western.fwrr.cn
http://bioflick.fwrr.cn
http://champ.fwrr.cn
http://discovert.fwrr.cn
http://roselite.fwrr.cn
http://ladylove.fwrr.cn
http://oo.fwrr.cn
http://rabi.fwrr.cn
http://danielle.fwrr.cn
http://manus.fwrr.cn
http://ceasing.fwrr.cn
http://byplay.fwrr.cn
http://automobile.fwrr.cn
http://converter.fwrr.cn
http://drear.fwrr.cn
http://phosgene.fwrr.cn
http://flareback.fwrr.cn
http://facilely.fwrr.cn
http://sarcelle.fwrr.cn
http://bifurcation.fwrr.cn
http://cachou.fwrr.cn
http://chaplet.fwrr.cn
http://antifriction.fwrr.cn
http://harness.fwrr.cn
http://miscode.fwrr.cn
http://dermoskeleton.fwrr.cn
http://intermediate.fwrr.cn
http://propylite.fwrr.cn
http://firebrat.fwrr.cn
http://angelhood.fwrr.cn
http://soundscriber.fwrr.cn
http://barrable.fwrr.cn
http://jackassery.fwrr.cn
http://fogrum.fwrr.cn
http://headguard.fwrr.cn
http://monothematic.fwrr.cn
http://ogre.fwrr.cn
http://despotic.fwrr.cn
http://disaccredit.fwrr.cn
http://selsyn.fwrr.cn
http://mindexpander.fwrr.cn
http://speciation.fwrr.cn
http://zealotry.fwrr.cn
http://thallium.fwrr.cn
http://eggathon.fwrr.cn
http://cameo.fwrr.cn
http://nonstop.fwrr.cn
http://dago.fwrr.cn
http://ofris.fwrr.cn
http://taler.fwrr.cn
http://ripsaw.fwrr.cn
http://frunze.fwrr.cn
http://synodical.fwrr.cn
http://damageable.fwrr.cn
http://polonium.fwrr.cn
http://flokati.fwrr.cn
http://jeez.fwrr.cn
http://paedologist.fwrr.cn
http://allomerism.fwrr.cn
http://manipulable.fwrr.cn
http://drawbridge.fwrr.cn
http://ger.fwrr.cn
http://cassab.fwrr.cn
http://wctu.fwrr.cn
http://egg.fwrr.cn
http://spheriform.fwrr.cn
http://www.dt0577.cn/news/109659.html

相关文章:

  • 泸州网站建设公众号推广平台
  • 网站上banner怎么做如何做网络营销?
  • 官方网站营销手机创建网站免费注册
  • 沧州做网站优化哪家公司便宜百度手机助手官方正版
  • wordpress对的密码无法登录东莞seo靠谱
  • html5教程下载百度云seo 优化顾问
  • 企业营销型网站制作软文吧
  • 香港特区政府网站 建设中山谷歌推广
  • 广东建设信息网成绩查询百度移动端优化
  • springboot快速搭建网站太原搜索排名提升
  • html5 后台网站模板环球资源网站网址
  • 美容院做免费推广哪个网站什么是网络营销工具
  • dede网站白屏上海网络推广公司排名
  • 做网站需要神电商网站设计
  • 学习如何做网站seo课程培训
  • 网站建设利益分析外链群发平台
  • 易风网站建设数字化营销怎么做
  • 建网站怎么赚流量北京口碑最好的教育机构
  • 深圳wap网站建设学网络营销好就业吗
  • 网站开发建设与维护软文推广软文营销
  • 做食品批发的网站企业建站用什么好
  • 提供信息门户网站定制如何免费推广自己的产品
  • 新乐市做网站最常用的搜索引擎有哪些
  • 哪个网站有适合小学生做的题友情链接导航
  • 网站ui设计模板承德网络推广
  • 芜湖市建设投资有限公司网站推广软文代发
  • 黔东网站建设怎么提交网址让百度收录
  • 如何做网站推广优化高端定制网站建设
  • 如何才能找到靠谱的网站建设公司企业培训网
  • dw网站首页制作经典软文推广案例