07 2019 档案
摘要:一、webpack配置 初始化npm和安装webpack 创建webpack.config.js 相关配置参数: Entry: 入口 Module:模块,webpack中一切皆是模块 Chunk:代码库,一个chunk由十多个模块组合而成,用于代码合并与分割 Loader:模块转换器,用于把模块原内
阅读全文
摘要:/* .babelrc */ { "presets": [ ["@babel/preset-env", { "modules": false, "useBuiltIns": "entry", "targets": "ie >= 8" }] ] } npm install @babel/core @b
阅读全文
摘要:class HashRouter{ constructor(){ //用于存储不同hash值对应的回调函数 this.routers = {}; window.addEventListener('hashchange',this.load.bind(this),false) } //用于注册每个视图
阅读全文
摘要:class HistoryRouter{ constructor(){ //用于存储不同path值对应的回调函数 this.routers = {}; this.listenPopState(); this.listenLink(); } //监听popstate listenPopState(){
阅读全文
摘要:运行异常: inputMisMatchExpection 输入类型不匹配 arrayIndexOutOfBoundsException 数组索引越界 nullProintException 空指针异常 应用为null negativeArraySizeExpection 数组长度不合法 增强的for
阅读全文
摘要:cookies:存储于浏览器端的数据。可以设置 cookies 的Max Age或者Expires到期时间,如果不设置时间,则在浏览器关闭窗口的时候会消失。 session:存储于服务器端的数据。session 存储特定用户会话所需的属性和配置信息。 cookies 和 session 的区别在于:
阅读全文
摘要://获取手机端本地文件路径 plus.io.resolveLocalFileSystemURL(url, success(e){ }, fail(e){ })
阅读全文
摘要:function mergeSort(items){ if (items.length == 1) { return items; } var work = []; for (var i=0, len=items.length; i < len; i++){ work.push([items[i]]
阅读全文
摘要:function formatDate(data) { const date = new Date(data) const year = date.getFullYear() let month = date.getMonth() + 1 let day = date.getDate() let h
阅读全文