03 2019 档案

摘要:js原生 函数防抖:将几次操作合并为一此操作进行。原理是维护一个计时器,规定在delay时间后触发函数,但是在delay时间内再次触发的话,就会取消之前的计时器而重新设置。这样一来,只有最后一次操作能被触发。 函数节流:使得一定时间内只触发一次函数。原理是通过判断是否到达一定时间来触发函数。 区别: 阅读全文
posted @ 2019-03-07 18:54 He先生的前端博客 阅读(453) 评论(0) 推荐(0)
摘要:PC端的弹性布局 var rem; $(window).resize(function () { //当浏览器大小变化时页面自适应大小 var Btype = BrowserType(); var whdef = 100/2160;// 表示2160的设计图,使用100PX的默认值 var hwde 阅读全文
posted @ 2019-03-06 15:40 He先生的前端博客 阅读(428) 评论(0) 推荐(0)
摘要:查看总分支git branch -a 查看本地分支git branch 切换本地分之 git checkout -b 本地分支名 origin/远程分支名 (本地没有分支)git checkout origin/本地分支名 ( 本地有分支的) 删除本地分支git branch -d 本地分支名 本地 阅读全文
posted @ 2019-03-04 18:44 He先生的前端博客 阅读(179) 评论(0) 推荐(0)
摘要:package.json { "name": "vue-cli", "version": "1.0.0", "description": "A Vue.js project", "author": "lizhi@camelotchina.com", "private": true, "scripts 阅读全文
posted @ 2019-03-03 15:46 He先生的前端博客 阅读(2518) 评论(0) 推荐(0)
摘要:1、转成千分位,保留两位 comdify(n) { let num = Number(n); let re = /\d{1,3}(?=(\d{3})+$)/g; let n1 = num.toFixed(2).replace(/^(\d+)((\.\d+)?)$/, function (s, s1, 阅读全文
posted @ 2019-03-03 15:01 He先生的前端博客 阅读(2763) 评论(0) 推荐(0)