常用的
1、百度地图AK。
我申请的不受限制的百度地图AK,测试什么的就可以用:
HbvBV7F1AXuwSV0E1StiRWEMAY0Mbp3G
2、淘宝NPM镜像。
没 翻 墙 的童鞋可以用:
npm install -g cnpm --registry=https://registry.npm.taobao.org
3、移动端的viewport。
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
4、console.log打印出美观的对象
console.log(JSON.stringify(list, null, 2));
5、去掉谷歌浏览器记住密码黄色背景色
:-webkit-autofill { -webkit-text-fill-color: #fff !important; transition: background-color 5000s ease-in-out 0s; }
input:-internal-autofill-previewed, input:-internal-autofill-selected, textarea:-internal-autofill-previewed, textarea:-internal-autofill-selected, select:-internal-autofill-previewed, select:-internal-autofill-selected { -webkit-text-fill-color: #fff !important; transition: background-color 5000s ease-in-out 0s !important; background-color: #fff !important; }
6、文字渐变+背景颜色渐变
// 文字渐变 .text { background: linear-gradient(to right, red, blue); -webkit-background-clip: text; color: transparent; }
// 背景渐变 #grad { background: -webkit-linear-gradient(red, blue); /* Safari 5.1 - 6.0 */ background: -o-linear-gradient(red, blue); /* Opera 11.1 - 12.0 */ background: -moz-linear-gradient(red, blue); /* Firefox 3.6 - 15 */ background: linear-gradient(red, blue); /* 标准的语法 */ }
7、npm安装less命令
npm install less less-loader --save-dev
8、ES6数组去重 [...new Set([1, 3, 1, 4])] 的结果为 [1, 3, 4]
[...new Set(arr)]
合并2个数组
let a = [1,2,3] let b = [4,5,6] console.log([...a, ...b])
9、Vue兼容IE
npm install babel-polyfill --save-dev /* webpack.base.conf.js */ module.exports = { entry: { 'babel-polyfill': 'babel-polyfill', app: './src/main.js' }, } npm install es6-promise --save-dev /* main.js */ import promise from 'es6-promise' promise.polyfill()
10、vsCode设置快捷输入代码
Ctrl + Shift + P => 搜索 snippets