Skip to content
This repository was archived by the owner on Feb 26, 2020. It is now read-only.

douxc/VueLoadingBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

自动给vue-resource的ajax请求添加loadingbar。默认请求时间超过300毫秒才显示,可以手动配置延迟的时间

add loading bar for Vue-resource or axios

vuejs and vue-resource (axios) required;

截图

LoadingBar截图

安装

npm install vueLoadingBar --save

<head> ... <link href="src/loadingbar.min.css" rel="stylesheet" type="text/css" /> </head> <body> ... <script src='src/loadingbar.js'></script> </body>

or

require('src/loadingbar.js')(Vue);

with webpack

... require('vueLoadingBar/src/loadingbar.css'); import Vue from 'vue'; import VueResource from 'vue-resource'; import vueLoadingBar from 'vueLoadingBar'; Vue.use(VueResource); Vue.use(vueLoadingBar);

注意

如果使用其他支持interceptors的第三方库,需要将第三方库挂载到Vue.http;

使用axios时可以不做任何处理或者绑定到Vue.axios、Vue.$axios

config

// 设置请求超过多少毫秒才显示,默认300毫秒 new Vue({...}).loadingBarDelay = 100;

About

配合Vue,自动给请求添加loadingbar;支持vue-resource和axios

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •