基于Vue 2.0 的页面加载进度条.
Vue; // 注册实例 let instance = this; // 初始化vueProgress instancestart; // 开始显示 ;
description
这是一种类似于Google, YouTube的ajax加载进度条插件,基于vue 2.0版本之上,可以自定义插件样式和效果。
Installation
Yarn
$ yarn add vue-progress
NPM
$ npm install vue-progress --save
Usage
1. 注册
Vue
2. 快速使用
let instance = this; // 初始化vueProgress instancestart; // 开始显示instance; // 结束
3. 设置初始进度
instance; // Sorta same as .start()instance;instance; // Sorta same as .done()
Configuration
初始化vueProgress 的时候,可以选择性传入参数进行控制
color
设置进度条颜色,默认是 blue
this;
speed
控制进度条速度,默认是 5
this;
percentNum
进度条每一步的跨度,取值0-1之前的小数。默认是0-1之间的随机数
this;
easing
右侧loading图标动画的贝塞尔曲线,默认 'linear'
this;
showSpinner
是否展示右侧loading动画,默认 true
this;
Examples
To run the examples; clone this repository & run npm install
in the root directory, and then run npm run dev
. Head to http://localhost:8080.