上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页
摘要: Function.prototype.bind = function(context, ...args){ return () => { return this.apply(context, args); } } function add (a, b) { return a + b; } conso 阅读全文
posted @ 2019-03-27 19:35 shangyueyue 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 一、函数中的this 在一个函数上下文中,this由调用者提供,由调用函数的方式来决定。如果调用者函数,被某一个对象所拥有,那么该函数在调用时,内部的this指向该对象。如果函数独立调用,那么该函数内部的this,则指向undefined。但是在非严格模式中,当this指向undefined时,它会 阅读全文
posted @ 2019-03-27 16:21 shangyueyue 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 一、 A higher-order component (HOC) is an advanced technique in React for reusing component logic. a higher-order component is a function that takes a c 阅读全文
posted @ 2019-03-27 15:20 shangyueyue 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 错误边界是用于捕获其子组件树 JavaScript 异常,记录错误并展示一个回退的 UI 的 React 组件,而不是整个组件树的异常。错误边界在渲染期间、生命周期方法内、以及整个组件树构造函数内捕获错误。 这样如果某个组件发生崩溃,会被其直属的异常边界捕获,从而保证剩余的部分依然处于可用状态。同样 阅读全文
posted @ 2019-03-23 19:17 shangyueyue 阅读(698) 评论(0) 推荐(0) 编辑
摘要: function isWx(){//判断是否为微信 var ua = window.navigator.userAgent.toLowerCase(); if(ua.match(/MicroMessenger/i) == 'micromessenger'){ return true; } return false; }; if(isWx()){//... 阅读全文
posted @ 2019-03-22 16:28 shangyueyue 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 一、同域 vs 不同域 同域,父页面可以对子页面进行改写,反之亦然 不同域,父页面没有权限改动子页面,但可以实现页面的跳转 二、 获取iframe里的内容 主要的两个API就是contentWindow,和contentDocumentiframe.contentWindow, 获取iframe的w 阅读全文
posted @ 2019-03-22 10:51 shangyueyue 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 一、a 标签 移动端不支持 阅读全文
posted @ 2019-03-21 15:05 shangyueyue 阅读(3720) 评论(0) 推荐(0) 编辑
摘要: Babel includes a polyfill that includes a custom regenerator runtime and core-js. This will emulate a full ES2015+ environment (no < Stage 4 proposals 阅读全文
posted @ 2019-03-14 18:39 shangyueyue 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 一、rootmode In 7.1, we've introduced a rootMode option for further lookup if necessary. 二、Remove proposal polyfills in @babel/polyfill Based on similar 阅读全文
posted @ 2019-03-14 18:38 shangyueyue 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 一、babel 二、@babel/core @babel/cli @babel/core 转换语法核心 @babel/cli 执行脚本 三、@babel/preset-env 四、babel-pollyfill The @babel/polyfill module includes core-js  阅读全文
posted @ 2019-03-13 10:32 shangyueyue 阅读(331) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页