01 2019 档案
摘要:一、用有意义且常用的单词命名变量 二、直接了当 bad: good: 三、避免无意义的前缀 bad: good: 四、使用默认值 bad: good: 五、参数越少越好 如果参数超过两个,使用 ES2015/ES6 的解构语法,不用考虑参数的顺序。 bad: good: 六、删除重复代码 bad:
阅读全文
摘要:// 这是目前用的比较多的方式 // 表示index和test2都使用keep-alive routes: [ { path: '/', redirect: '/index', component: Index, meta: { keepAlive: true }}, { path: '/common', component: TestParent,...
阅读全文
摘要:/*手机横屏时执行*/ @media screen and (orientation:landscape){ .txtle{ color: red } } /*手机竖屏时执行*/ @media screen and (orientation:portrait){ #wrap{ display:none; } }
阅读全文
摘要:1 (function (doc, win) { 2 var docEl = doc.documentElement, 3 resizeEvt = 'onorientationchange' in window ? 'onorientationchange' : 'resize', 4 recalc
阅读全文