上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页
摘要: 深浅拷贝顾名思义就是复制的深浅情况, 深拷贝会复制每一层,浅拷贝则不会,只要没复制到最后一层都是浅拷贝。 深拷贝原则上需要深度递归的方式解决或JSON.parse(JSON.stringify(object))。 Object.assign 也为浅拷贝(真对2层以上),只不过比普通复制深一层。 JS 阅读全文
posted @ 2019-12-10 21:08 lipu1993 阅读(89) 评论(0) 推荐(0)
摘要: 解决作用域的问题 for (var i = 1; i <= 5; i++) { setTimeout(function timer() { console.log(i) }, i * 1000) } 立即执行 for (var i = 1; i <= 5; i++) { ;(function(j) 阅读全文
posted @ 2019-12-10 20:54 lipu1993 阅读(480) 评论(0) 推荐(0)
摘要: 它们均可以改变this指向 apply和call简单的说都是一样的东西,只是参数不同 obj.Fun.call(nd); obj.Fun.apply(nd); 其中call可以传多个参数,apply只能传两个参数 obj.Fun.call(nd,xx,xx); obj.Fun.apply(nd,[x 阅读全文
posted @ 2019-12-10 16:05 lipu1993 阅读(122) 评论(0) 推荐(0)
摘要: 通过Object.defineProperty重新定义get和set,来实现数据的双向获取。 参考:https://www.jb51.net/article/143456.htm 阅读全文
posted @ 2019-12-06 15:37 lipu1993 阅读(119) 评论(0) 推荐(0)
摘要: vue-class-component 安装 npm install vue-class-component vue-property-decorator --save-dev get=>computed set=>当检测到值发生变化是会调用set 参考:https://my.oschina.net 阅读全文
posted @ 2019-12-05 22:14 lipu1993 阅读(2325) 评论(0) 推荐(0)
摘要: 接口调用 前端分两层 先 controller 定义 然后service 定义引入 阅读全文
posted @ 2019-12-05 19:06 lipu1993 阅读(162) 评论(0) 推荐(0)
摘要: 安装react npm install -g create-react-app create-react-app demo01 //用脚手架创建React项目 cd demo01 //等创建完成后,进入项目目录 npm start //预览项目,如果能正常打开,说明项目创建成功 阅读全文
posted @ 2019-12-05 14:26 lipu1993 阅读(108) 评论(0) 推荐(0)
摘要: 直接在路由中设置即可,首先要引入Error页面 {path:"*",component:Error} 阅读全文
posted @ 2019-11-30 15:53 lipu1993 阅读(66) 评论(0) 推荐(0)
摘要: 路由守卫可以在路由跳转处进行检查,未达到要求不予跳转 const router = new Router({ {path:'/',name:'test1',component:test1}, {path:'/home',name:'home',component:home}, {path:'/log 阅读全文
posted @ 2019-11-30 15:27 lipu1993 阅读(137) 评论(0) 推荐(0)
摘要: shift+Alt+向下箭头 阅读全文
posted @ 2019-11-30 10:31 lipu1993 阅读(2802) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页