var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return tar
使用es6+新语法编写代码,可是不能运行于低版本浏览器,需要将语法转换成es5的.那就借助babel7转换,再加上webpack打包,实现代码的转换. 转换包括两部分:语法和API let.const这些是新语法. new promise()等这些是新API. 简单代码 类库 utils.js const name = 'weiqinl' let year = new Date().getFullYear() export { name, year } index.js import _ fro
iview是个好东西,今天第一次试用,用来做了一个app,但是在安卓5.1各种报错啊,头痛的是不知道具体哪行代码错了,总是报错undefined is not a function. 倒腾了半天,原来是iview的select中用了Array.find.array.findIndex方法.原来浏览器版本低了,不兼容这些JavaScript特性.果断的给打上补丁就好了 if(typeof Array.includes == 'undefined'){ Array.prototype.include
直接上例子,看如何避免crash. eg:根据给出路径,获取此路径所在分区的总空间大小. 文档说明:获取文件系统用量情况,在API level 9及其以上的系统,可直接调用File对象的相关方法,以下需自行计算 API level 9及其以上,调用 File.getTotalSpace() 即可, 但是在API level 8 以下系统File对象并不存在此方法 //如下 /** * Returns the total size in bytes of the partition contain