摘要: ``` getCookie (name) { // 获取cookie const cookieContent = '; ' + document.cookie const cookies = cookieContent.split( ) return cookies.length 1 ? cooki 阅读全文
posted @ 2019-03-13 18:56 yangAL 阅读(110) 评论(0) 推荐(0) 编辑
摘要: ``` Vue.filter('money', (value, symbol = '', currency = '¥', decimals = 0) = { const digitsRE = /(\d{3})(?=\d)/g value = parseFloat(value) if (!isFini 阅读全文
posted @ 2019-03-13 18:52 yangAL 阅读(197) 评论(0) 推荐(0) 编辑
摘要: ``` //获取侧边栏 if (sessionStorage.getItem( )) { const leftMenu = JSON.parse(sessionStorage.getItem( )) store.dispatch('setLeftMenu', leftMenu) } else { i 阅读全文
posted @ 2019-03-13 18:49 yangAL 阅读(2358) 评论(0) 推荐(0) 编辑
摘要: ``` objWin = window.open(routeUrl.href, obj.code) objWin.focus() ``` 阅读全文
posted @ 2019-03-13 18:45 yangAL 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 需求每天多个时间段里可认领,在可认领时间段的倒计时一小时内,显示倒计时;在可认领时间段内,按钮为亮色;不在可认领时间段内,按钮为灰色 解决: const timeSolts = res.data.data.limitTime // const timeSolts = '10:40 11:00;12: 阅读全文
posted @ 2019-03-13 18:42 yangAL 阅读(268) 评论(0) 推荐(0) 编辑
摘要: ``` // 睡眠 await this.sleep(300) sleep (ms) { return new Promise((resolve, reject) => { setTimeout(() => { resolve() }, ms) }) }, ``` 阅读全文
posted @ 2019-03-13 18:33 yangAL 阅读(881) 评论(0) 推荐(0) 编辑
摘要: 需求:页面上方有许多标签,每点击一个标签或者取消一个标签都会调用接口查询数据,渲染到表格中。 问题1:当数据较多时,表格渲染的比较慢 问题2:当点击过快时,可能标签1对应的接口的返回数据1还没返回的时候,又点击了标签2,对应的接口返回的数据2返回开始渲染,数据2渲染一半时,数据1也回来了也开始渲染, 阅读全文
posted @ 2019-03-13 18:31 yangAL 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 1:需求:项目的侧边栏实现换肤功能,核心代码: updateSkin (val) { const existSkinLink = document.head.querySelector('link[id="sidebar"]') if (existSkinLink) { existSkinLink. 阅读全文
posted @ 2019-03-13 17:39 yangAL 阅读(280) 评论(0) 推荐(0) 编辑