1.性能优化
https://mp.weixin.qq.com/s/LqsfX0BrpOFzc0B0rcqBqw
代码层面
https://mp.weixin.qq.com/s/STK5sSW6ly6f89sD2CgYbQ
https://mp.weixin.qq.com/s/GUGnV-rX_HNtTeoL3P0nig
首页加载速度优化
https://mp.weixin.qq.com/s/2w2wHnxuMcZ5SMDn3mjt_Q
1.减少HTTP资源请求次数
2.减少HTTP请求大小
3.减少页面重定向
4.使用可缓存的AJAX
5.把CSS资源引用放到HTML文件顶部
6.JavaScript资源引用放到HTML文件底部
https://mp.weixin.qq.com/s/WZuTtdjo-Ofdk7G5nqPDsw
图片懒加载
使用CSS3动画,开启GPU加速
https://www.jianshu.com/p/d9c20eafa67e
if for 遍历 dom操作 消耗性能
性能优化
https://mp.weixin.qq.com/s/SM1po543uVENh9k7Rh8ZPw
页面一打开就有30个重复请求,优化
https://mp.weixin.qq.com/s/upNhcPLD2Td3NShAoWzEGQ
渲染100万个元素,并且保证页面不卡顿
https://mp.weixin.qq.com/s/YWOm2vn6EOhgtFE7JJycUg
海量 JSON 数据
https://mp.weixin.qq.com/s/x8L_41V2zHGM-WHTlg9ExA
2.图片
https://blog.csdn.net/m0_74798823/article/details/147440696
前端图片压缩上传,减少等待时间!优化用户体检
https://mp.weixin.qq.com/s/Cm-7teN8f9RkBL8rP9FHnw
前端加载超大图片(100M以上)实现秒开
https://mp.weixin.qq.com/s/xGRBl8xE-9cOh8w9bcOxGQ
渐进式图片
https://mp.weixin.qq.com/s/rNOWMPh1sOhVqpRe2dxfvA
3.图片预加载
4.图片懒加载
https://www.jianshu.com/p/f9b1183b13af
https://mp.weixin.qq.com/s/UT6HnwSsPqvphJ7iduiVNQ
Vue.use(VueLazyload, {
loading: require('@/assets/empty_chanping.png'),//加载中图片,一定要有,不然会一直重复加载占位图
error: require('@/assets/empty_chanping.png') //加载失败图片
});
5.webpack优化
webpack代码优化
https://mp.weixin.qq.com/s/T-cDo4l2DxXWT5CjiFXDow
https://blog.csdn.net/weixin_46087056/article/details/145682648
https://mp.weixin.qq.com/s/CO5fduyISgOFZS-fsFb_Tg
开发阶段-按需加载
https://mp.weixin.qq.com/s/ddf1WPUX-aRb1K8QnTkEnw
6.Vue3性能优化
7.Vite性能优化
https://mp.weixin.qq.com/s/SKYQzmXA2XTBi6Qkxo_YBA
https://blog.csdn.net/React_Community/article/details/151878327