1.0.6 • Published 6 years ago
web-uts v1.0.6
📦 Install
npm install web-uts
yarn add web-uts
🔨 Usage
placeholder
placeholder兼容ie9
import { placeholder} from 'web-uts';
placeholder();
download
下载文件兼容ie9
import {download } from 'web-uts';
download('xxx') //xxx为资源路径
Loader
加载资源的时候显示进度条
import { Loader } from 'web-uts';
const loader = new Loader({
resource : [
'https://cdn.bootcss.com/socket.io/2.2.0/socket.io.js',
'https://cdn.bootcss.com/zepto/1.0rc1/zepto.min.js',
'https://cdn.bootcss.com/jquery/3.4.1/jquery.js',
'https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js',
],
onStart : function(total){
console.log('start:'+total);
},
onProgress : function(current, total){
console.log(current+'/'+total);
},
onComplete : function(total){
console.log('加载完毕:'+total+'个资源')
}
}).start();
config 字段说明