1.0.6 • Published 5 years ago

@onaug6th/load-bar v1.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

loadBar

npm (scoped)

一个漂亮,强大的进度条插件。监听http请求的状态,并且直观的展示Http请求进度。

简体中文 | English

Docs/演示文档

启动

npm run dev

构建生产

npm run build

使用

使用 npm:

npm i @onaug6th/load-bar

使用script标签:

<script src="/dist/loadBar.min.js"></script>

例子

页面中先引入jquery,然后再引入loadBar.min.js。

$("body").loadBar();

var options = {...}
$("#other").loadBar(options);

options 配置

var opt = {
    displayOnRequest: false,
    height: 200,
    endLoad: function(){
        //  do sth
    }
}
$("body").loadBar(opt);
名称说明类型默认值
displayOnRequest是否在请求中展示Booleantrue
background进度条背景色String#29d
img是否使用图片String
height进度条高度Number, String2px
all任何事件都会触发Functionnoop
startLoad进度条出现前触发Functionnoop
endLoad进度条消失后触发Functionnoop
mounted进度条挂载后触发Functionnoop

事件

$("body").on("startLoad", function(){
    //  do sth
})
名称说明类型
all任何事件都会触发Function
startLoad进度条出现前触发Function
endLoad进度条消失后触发Function
mounted进度条挂载后触发Function

方法

$("body").loadBar("start");
//  or
$("body").loadBar("getOpt", "img");
//  or
$("body").loadBar("setOpt", "img", yourPath);
名称说明参数
start进度条开始
end进度条结束
setOpt设置进度条配置属性attrName: String Object, value: String
getOpt获取配置属性attrName: String
destroy摧毁进度条
sayName打招呼name:string

License

MIT

have a nide day

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago