返回顶部
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 24 下一页
摘要: 搬运自:https://segmentfault.com/a/1190000019610283?utm_source=tag-newest vue官方API: https://cn.vuejs.org/v2/api/#keep-alive 例: router.js: { path: '/home', 阅读全文
posted @ 2020-01-19 17:22 前端-xyq 阅读(10600) 评论(0) 推荐(0) 编辑
摘要: 参考:https://segmentfault.com/q/1010000010829474 问题:列表页进详情页,第一次很慢,第二次就很快。 原因:我原本是使用组件懒加载,每次第一次切换路由的时候,都要去加载相应的组件的js文件,需要等文件加载完之后,路由才能切换过去。后面切换的话js都下载过了, 阅读全文
posted @ 2020-01-19 11:31 前端-xyq 阅读(1066) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.jianshu.com/p/40da0ba35ac1 1. 安装 npm install babel-plugin-component –D 2. 修改.babelrc 原babelrc: { "presets": [ ["env", { "modules": fals 阅读全文
posted @ 2020-01-14 10:47 前端-xyq 阅读(2013) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.jianshu.com/p/48ecd9ba8d74 页面: <div @scroll="checkLazyLoad" ref="home" v-for="item in list"> <div class="gimg"> <img v-if="item.isLoadS 阅读全文
posted @ 2020-01-13 17:52 前端-xyq 阅读(513) 评论(0) 推荐(0) 编辑
摘要: 参考: https://blog.csdn.net/lilinoscar/article/details/80539725 需求:tab切换,选项高亮。 原css:圆圈元素会有的扁,有的圆。刚开始审查元素时发现border超出,以为是这个问题。后来参考文章后发现是单位问题。 .cirlce { wi 阅读全文
posted @ 2020-01-10 18:14 前端-xyq 阅读(1827) 评论(0) 推荐(0) 编辑
摘要: 参考:https://blog.csdn.net/qq_20264891/article/details/87873311 父元素: position: relative; 居中元素: position: absolute; top: 50%; //基于父元素 left: 50%; //基于父元素 阅读全文
posted @ 2020-01-10 18:05 前端-xyq 阅读(3336) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.jianshu.com/p/a7550c0e164f 原理: Vue.nextTick用于延迟执行一段代码,为了在数据变化之后等待 Vue 完成更新 DOM ,可以在数据变化之后立即使用Vue.nextTick(callback) 。这样回调函数在 DOM 更新完成后就 阅读全文
posted @ 2020-01-10 10:59 前端-xyq 阅读(4334) 评论(0) 推荐(1) 编辑
摘要: 页面: <template> <div id="d-whole"> <div id="d-top"> //顶部固定区域 ··· </div> <div id="d-scroll" :style="obj" @scroll="listenScroll"> //滚动区域 ··· <div> </div> 阅读全文
posted @ 2020-01-08 14:31 前端-xyq 阅读(8091) 评论(0) 推荐(0) 编辑
摘要: 需求:列表页分页,跳转详情页时,保存当前页数和搜索关键词。从详情页返回时,回到之前页数并搜索同一关键词。 js: mainApp.factory('theParam', function() { return { currentPage : 1,pageSize : 12,param:'' }; } 阅读全文
posted @ 2019-12-31 10:49 前端-xyq 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 需求:金额格式化为有两位小数,不足补0 js: mainApp.filter('addZeroTwo', function() { //金额格式化 return function(value) { if(value '' || value null || value undefined){ retu 阅读全文
posted @ 2019-12-31 10:29 前端-xyq 阅读(647) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 24 下一页