摘要: class Point{ } Object.assign方法可以很方便地一次向类添加多个方法。 阅读全文
posted @ 2018-06-13 19:44 艾礼富 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 安装成功后,package.json 这个文件会多出一行 "html-webpack-plugin": "^2.30.1",,如下所示: webpack.config.js 内容大约是下面这样的: 阅读全文
posted @ 2018-03-22 11:21 艾礼富 阅读(102) 评论(0) 推荐(0) 编辑
摘要: You may need an appropriate loader to handle this file type. 意思是webpack需要是个插件来出来这个类型的文件! 当安装node-sass处理scss文件的时候,会报错,处理方法是先全局使用sudo npm install -g --u 阅读全文
posted @ 2018-03-19 10:21 艾礼富 阅读(114) 评论(0) 推荐(0) 编辑
摘要: // return obj { length: 字节长度, limitStr: 限定的字符串(字节长度小于等于intVal) } function getStringByteInfo ( string, intVal ) { var str = $.trim(string) || '', lengt 阅读全文
posted @ 2018-01-22 14:51 艾礼富 阅读(160) 评论(0) 推荐(0) 编辑
摘要: document.write(unescape("\u62db\u8d22\u7ae5\u5b50")) 阅读全文
posted @ 2018-01-15 16:10 艾礼富 阅读(121) 评论(0) 推荐(0) 编辑
摘要: var classVal = document.getElementById("id").getAttribute("class"); //删除的话 classVal = classVal.replace("someClassName",""); document.getElementById("i 阅读全文
posted @ 2018-01-15 14:57 艾礼富 阅读(160) 评论(0) 推荐(0) 编辑
摘要: $.fn.extend({ propAttr: $.fn.prop || $.fn.attr, _oldFocus: $.fn.focus,//为避免与jQuery ui冲突导致死循环,这里不要取名为'_focus' //设置元素焦点(delay:延迟时间) focus: function( del 阅读全文
posted @ 2018-01-08 09:55 艾礼富 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 有三种方法能够确定浏览器窗口的尺寸(浏览器的视口,不包括工具栏和滚动条)。 对于Internet Explorer、Chrome、Firefox、Opera 以及 Safari: window.innerHeight - 浏览器窗口的内部高度 window.innerWidth - 浏览器窗口的内部 阅读全文
posted @ 2018-01-06 09:59 艾礼富 阅读(1846) 评论(0) 推荐(0) 编辑
摘要: 面比较一下默认输出和正常输出。 // 第一组export default function crc32() { // 输出 // ...} import crc32 from 'crc32'; // 输入 // 第二组export function crc32() { // 输出 // ...}; 阅读全文
posted @ 2018-01-06 09:29 艾礼富 阅读(190) 评论(0) 推荐(0) 编辑
摘要: React.createClass({ propTypes: { // 可以声明 prop 为指定的 JS 基本数据类型,默认情况,这些数据是可选的 optionalArray: React.PropTypes.array, optionalBool: React.PropTypes.bool, o 阅读全文
posted @ 2018-01-05 13:43 艾礼富 阅读(236) 评论(0) 推荐(0) 编辑