随笔分类 - 基础问题总结
摘要:https://github.com/rohan-paul/Awesome-JavaScript-Interviewshttps://github.com/nieyafei/front-end-interview-js前端面试interview的Js题目收集https://github.com/ji
阅读全文
摘要:当在router.beforeEach((to, from, next) 钩子函数中使用: 1、使用next()时,直接跳转到下一页,没有再执行导航钩子函数 2、使用next('指定路径')跳转到指定页面还会执行钩子函数所以会死循环。 所以在钩子函数中使用next('指定路径')时候: 一般会加判断
阅读全文
摘要:5、几种实现div水平垂直居中的方法: /* 1、定位代码 */ .wp {position: relative;} .box { position: absolute; top: 50%; left: 50%; margin-left: -50px; margin-top: -50px; } /*
阅读全文
摘要:1.深拷贝对象: const a={name:'aaa',age:11} const b=JSON.parse(JSON.stringify(a)) 2.获取数组极值: let list = [1, 2, 3, 4, 5] Math.max(...list) // 5 Math.min(...list) // 1
阅读全文
摘要://手机号加密 export function formatPhone(phone) { return phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2"); } //身份证加密 export function formatIdcard(idcard) { return idcard.replace(/(\d{4})\d*([0-9a-zA-Z]{4})
阅读全文
摘要://过滤数据,status为空则删除数据 Array.from(data).forEach((item, index) => { if (item.status.length 0) { console.log(item, index); data.splice(data[index], 1); } });
阅读全文
摘要:200:成功400:请求错误,服务器不理解请求的语法401:未授权404:未找到,服务器找不到请求的页面500:服务器错误,服务器内部错误,无法请求502:错误网关,服务器作为网关或代理出现错误503:服务器不可用,服务器目前无法使用504:网关超时
阅读全文
摘要:<img src="img/img.png"/> img{ width:300px; height:100px; object-fit:cover; }
阅读全文
摘要:.img{ background: url("../assets/image/img.png"); background-size: 100% 100%; height: 100%; position: fixed; width: 100%; }
阅读全文
摘要:Git 常用命令 1. cd 项目目录 2.git init //变成git仓库 3.git add . //将项目添加到本地仓库 4.git commit -m '备注' //将项目提交到仓库 5.新建一个远程仓库,通过git remote add origin https://github.co
阅读全文
摘要:1.map let arr = [1,2,3,4,5] let newarr =arr.map(item=>{ arr.push(10) return item*2 }) console.log(arr) //[1, 2, 3, 4, 5,10,10,10,10,10] console.log(ne
阅读全文
摘要:git add . //添加到本地缓存区 git commit -m '备注 ' //提交代码到本地仓库 git push //将本地代码推送到develop分支上 git checkout master // 切换到master主分支上 git merge develop //将develop 分
阅读全文

浙公网安备 33010602011771号