New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

web-uts

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

web-uts

web-uts

unpublished
latest
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

📦 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 字段说明

字段类型是否必选参数默认值说明
showProgressBooleanNtrue是否显示进度条
progressClassNameStringNprogress进度条class名称
resourceArrayY[]需要在head中添加的资源
onStartFunctionNtotal(total)=>{}开始前调用
onProgressFunctionNcurrent,totalonProgress:(current,total)=>{}进行中调用
onCompleteFunctionNtotalonComplete:(total)=>{}完成时调用
onErrorFunctionNeonComplete:(e)=>{}出错时调用

Keywords

web-tools

FAQs

Package last updated on 16 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts