在Vue日常开发中的经验总结
年少有为的BUG制造者
1 | sort_pro(data, keys = []) { |
1 | let map = {}; |
在前端开发中,F12审查元素的情况下,大家都可以随机更改一部分页面的代码,注入恶意JS等等,这种情况避免也不难,虽然还能看到一部分H5源码,但是无法修改。
1 | document.onkeydown = function () { |
1 | document.oncontextmenu = function (event) { |
1 | document.onpaste = function (event) { |
1 | document.oncopy = function (event) { |
1 | document.oncut = function (event) { |
1 | document.onselectstart = function (event) { |
在日常做项目中用了一些很好用的ES6新的属性方法,我总结了一部分,想了解更多内容的请去ES6教程查看
1 | let arr = ['apple','banana','orange']; |
1 | function show(...a){ |
1 | let name ='dqq'; |
1 | let arr = [ |
1 | let arr = [ |
arr.find(): 查找,找出第一个符合条件的数组成员,如果没有找到,返回undefined
1 | let arr = [23,900,101,80,100]; |
arr.findIndex(): 找的是位置, 没找到返回-1
1 | let arr = [23,900,101,80,100]; |
Array.from:
作用: 把类数组(获取一组元素、arguments…) 对象转成数组
个人观点: 具备 length这个东西,就靠谱
1 | let str = 'Strive'; |
Array.of(): 把一组值,转成数组
1 | let arr = Array.of('apple','banana','orange'); |
Set数组去重,返回新的数组
1 | let arr = [1,2,3,4,5,6,7,6,5,4,3,2,1,2,3,4,4]; |
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
1 | $ hexo new "My New Post" |
More info: Writing
1 | $ hexo server |
More info: Server
1 | $ hexo generate |
More info: Generating
1 | $ hexo deploy |
More info: Deployment
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent: meta: false pages: false posts: title: true date: true path: true text: false raw: false content: false slug: false updated: false comments: false link: false permalink: false excerpt: false categories: false tags: true