Giter Site home page Giter Site logo

vue-progressbar's Introduction

vue-progressbar

Table of Contents

Demo

Demo

Requirements

Installation

# npm
$ npm install vue-progressbar

#yarn
$ yarn add vue-progressbar

Usage

main.js

import Vue from 'vue'
import VueProgressBar from 'vue-progressbar'
import App from './App'

const options = {
  color: '#bffaf3',
  failedColor: '#874b4b',
  thickness: '5px',
  transition: {
    speed: '0.2s',
    opacity: '0.6s',
    termination: 300
  },
  autoRevert: true,
  location: 'left',
  inverse: false
}

Vue.use(VueProgressBar, options)

new Vue({
  ...App
}).$mount('#app')

Constructor Options

key description default options
color color of the progress bar 'rgb(143, 255, 199)' RGB HEX HSL HSV VEC
failedColor color of the progress bar upon load fail 'red' RGB, HEX, HSL, HSV, VEC
thickness thickness of the progress bar '2px' px, em, pt, %, vh, vw
transition transition speed/opacity/termination of the progress bar {speed: '0.2s', opacity: '0.6s', termination: 300} speed, opacity, termination
autoRevert will temporary color changes automatically revert upon completion or fail true true, false
location change the location of the progress bar top left, right, top, bottom
position change the position of the progress bar fixed relative, absolute, fixed
inverse inverse the direction of the progress bar false true, false
autoFinish allow the progress bar to finish automatically when it is close to 100% true true, false

Implementation

App.vue

<template>
    <div id="app">
        <!-- for example router view -->
        <router-view></router-view>
        <!-- set progressbar -->
        <vue-progress-bar></vue-progress-bar>
    </div>
</template>

<script>
export default {
  mounted () {
    //  [App.vue specific] When App.vue is finish loading finish the progress bar
    this.$Progress.finish()
  },
  created () {
    //  [App.vue specific] When App.vue is first loaded start the progress bar
    this.$Progress.start()
    //  hook the progress bar to start before we move router-view
    this.$router.beforeEach((to, from, next) => {
      //  does the page we want to go to have a meta.progress object
      if (to.meta.progress !== undefined) {
        let meta = to.meta.progress
        // parse meta tags
        this.$Progress.parseMeta(meta)
      }
      //  start the progress bar
      this.$Progress.start()
      //  continue to next page
      next()
    })
    //  hook the progress bar to finish after we've finished moving router-view
    this.$router.afterEach((to, from) => {
      //  finish the progress bar
      this.$Progress.finish()
    })
  }
}
</script>

vue-router

export default [
  {
    path: '/achievement',
    name: 'achievement',
    component: './components/Achievement.vue',
    meta: {
      progress: {
        func: [
          {call: 'color', modifier: 'temp', argument: '#ffb000'},
          {call: 'fail', modifier: 'temp', argument: '#6e0000'},
          {call: 'location', modifier: 'temp', argument: 'top'},
          {call: 'transition', modifier: 'temp', argument: {speed: '1.5s', opacity: '0.6s', termination: 400}}
        ]
      }
    }
  }
]

vue-router meta options

call modifier argument example
color set, temp string {call: 'color', modifier: 'temp', argument: '#ffb000'}
fail set, temp string {call: 'fail', modifier: 'temp', argument: '#ffb000'}
location set, temp string {call: 'location', modifier: 'temp', argument: 'top'}
transition set, temp object {call: 'transition', modifier: 'temp', argument: {speed: '0.6s', opacity: '0.6s', termination: 400}}

Methods

function description parameters example
start start the progress bar loading N/A this.$Progress.start()
finish finish the progress bar loading N/A this.$Progress.finish()
fail cause the progress bar to end and fail N/A this.$Progress.fail()
increase increase the progress bar by a certain % number: integer this.$Progress.increase(number)
decrease decrease the progress bar by a certain % number: integer this.$Progress.decrease(number)
set set the progress bar % number: integer this.$Progress.set(number)
setFailColor cause the fail color to permanently change color: string this.$Progress.setFailColor(color)
setColor cause the progress color to permanently change color: string this.$Progress.setColor(color)
setLocation cause the progress bar location to permanently change location: string this.$Progress.setLocation(location)
setTransition cause the progress bar transition speed/opacity/termination to permanently change transition: object this.$Progress.setTransition(transition)
tempFailColor cause the fail color to change (temporarily) color: string this.$Progress.tempFailColor(color)
tempColor cause the progress color to change (temporarily) color: string this.$Progress.tempColor(color)
tempLocation cause the progress bar location to change (temporarily) location: string this.$Progress.tempLocation(location)
tempTransition cause the progress bar location to change (temporarily) transition: object this.$Progress.tempTransition(transition)
revertColor cause the temporarily set progress color to revert back to it's previous color N/A this.$Progress.revertColor()
revertFailColor cause the temporarily set fail color to revert back to it's previous color N/A this.$Progress.revertFailColor()
revertTransition cause the temporarily set transition to revert back to it's previous state N/A this.$Progress.revertTransition()
revert cause the temporarily set progress and/or fail color to their previous colors N/A this.$Progress.revert()
parseMeta parses progress meta data meta: object this.$Progress.parseMeta(meta)

Examples

Loading Data (vue-resource)

<script>
export default {
  methods: {
    test () {
      this.$Progress.start()
      this.$http.jsonp('http://api.rottentomatoes.com/api/public/v1.0/lists/movies/in_theaters.json?apikey=7waqfqbprs7pajbz28mqf6vz')
      .then((response) => {
          this.$Progress.finish()
      }, (response) => {
          this.$Progress.fail()
      })
    }
  }
}
</script>

Accessing the progress bar externally through the vue instance (e.g. axios interceptors)

main.js

// main.js from Usage section

Vue.use(VueProgressBar, options)

export default new Vue({ // export the Vue instance
  ...App
}).$mount('#app')

api-axios.js

import axios from 'axios';
import app from '../main'; // import the instance

const instance = axios.create({
    baseURL: '/api'
});

instance.interceptors.request.use(config => {
    app.$Progress.start(); // for every request start the progress
    return config;
});

instance.interceptors.response.use(response => {
    app.$Progress.finish(); // finish when a response is received
    return response;
});

export default instance; // export axios instance to be imported in your app

License

The MIT License

vue-progressbar's People

Contributors

albinodrought avatar boomhq avatar chiaweilee avatar createvibe avatar funkjedi avatar hilongjw avatar kalasoo avatar lmvdz avatar malinbranduse avatar ndelvalle avatar pedrock avatar rfp avatar riokai avatar wdmtech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-progressbar's Issues

How to use loading in vuex ajax loading

HI~

my most of Ajax was in the action of vuex,how to use loading in vuex ajax loading ?

const actions = {
  [type.FETCH_MOVIES] (context, payload) {
    api.fetchMovies(payload.type, {start: payload.start || 0})
      .then(data => context.commit(type.FETCH_MOVIES, {
        type: payload.type,
        subjects: data.subjects,
        total: data.total
      }))
  }
}

渐变色

希望可以支持渐变色的进度条

    let style = {
        'background': this.progress.options.canSuccess ? this.progress.options.color : this.progress.options.failedColor,
        'opacity': this.progress.options.show ? 1 : 0
    }

Use CSS for styling

I think it would be great if the progress bar styling would not be applied to the element but rather via CSS classes, so we could style the progress bar by ourselves, by using .vue-progressbar together with modifier classes for .loading, .finish and .fail.
For example, my layout consists of a left nav bar and a content area. It would be nice if I could change the left: 0px to left: 50px without too much hassle.

Using start() and finish() on vuex axios call

Doing something like this won't work, since we don't have the context ("this") inside vuex:

login: ({ commit }, data) => {
    this.$Progress.start();

    axios.post('auth/login', params).then((response) => {
        if (response.status === 200) {
            this.$Progress.finish();
        }
    })
    .catch((error) => {
        console.log(error);
    });
},

As using vuex and axios is becoming more and more the de facto standard for medium and large applications, it would be a deal breaker if we couldn't do something like this. Is there any solution that doesn't involve "hacking it" by emitting events?

Github Pages example/documentation is inconsistent with the repository

I wanted to change the height of the loading bar.

On the Github Pages link, it says:

Vue.use(VueProgressBar, {
  color: 'rgb(143, 255, 199)',
  failedColor: 'red',
  height: '2px'
})

This didn't work - my bar was staying 2px tall no matter what.

On the Repository, it says:

const options = {
  color: '#bffaf3',
  failedColor: '#874b4b',
  thickness: '5px',
  transition: {
    speed: '0.2s',
    opacity: '0.6s',
    termination: 300
  },
  autoRevert: true,
  location: 'left',
  inverse: false
}

This did work - I could make my bar any height.

Not sure if the docs are outdated (haven't been published in a while), or incorrect, or something else. The Github Pages are linked to from the main repository page: https://github.com/hilongjw/vue-progressbar

Work with vue 2.5.9 ?

I have implement this awesome package in my vue 2.5.9, no error but nothing happen :/

Node package update

Hey, just wondering if you update the NPM package on a cycle, or if you have to do it manually for me to get the latest changes. Cheers :-)

Progress bar for all api calls at one palce

How can we configure the progress bar for all api calls at global place. So that if any api call goes from our app, it will automatically shows the progress bar.

I'm using the below code for interceptors. But when i add it, it's giving an error.
The below code is in main.js where i'm setting the progress bar.

const options = {
  color: '#2ecc71',
  failedColor: '#f16559',
  thickness: '4px',
  transition: {
    speed: '0.2s',
    opacity: '0.5s',
    termination: 300,
  },
  autoRevert: true,
  location: 'top',
  inverse: false,
};
Vue.use(VueProgressBar, options);

Vue.http.interceptors.push((request, next) => {
  next((response) => {
    /** some response content**/
   });
});

How can we setup this so that it shows for all api calls, which will reduce the calling of below methods at all api calls.

this.$Progress.start();
this.$Progress.finish();

GitHub Page error

On the website version of the site you have a spelling mistake that makes the progress bars not work. Under the "app.vue" you have put "precent" instead of "percent".

naming convention

Isn't it better to name the methods:
this.$progress.finish() this.$progress.failed()
like this:

this.$progress.finished() this.$progress.failed()
or

this.$progress.finish() this.$progress.fail()
To get a better naming convention

Plugin is great though.

Demo page still has precent typos

precent => percent typos fixed in commit "2ab662423afa6208720fd0a75d717809296f65b0" are still visible on the demo page.

Thank You for the useful module!

urgent feature request :)

 hide: function hide() {
            var _this2 = this;
            clearInterval(this.state.timer), this.state.timer = null, setTimeout(function() {
                _this2.$vm.RADON_LOADING_BAR.options.show = !1, a.nextTick(function() {
                    setTimeout(function() {
                        _this2.$vm.RADON_LOADING_BAR.percent = 0
                    }, 100), _this2.$vm.RADON_LOADING_BAR.options.autoRevert && setTimeout(function() {
                        _this2.revert()
                    }, 300)
                })
            }, 800)
        }

Hello, i liked your plugin but i have a problem, 800 ms is too much to clear view, could you improve structure to customize this time?

如果请求时间过长会自动结束?

您好,
我在使用 ajax 开始时 Vue.$Progress.start()
当请求时间比较长时,发现进度条走个七、八秒就自动结束了,而此时 ajax 请求还在 pending 状态。
请问这种情况是正常的吗?
谢谢

Support with Vue Router

I am trying to make this work with vue router like below

const app = new Vue({
  router
}).$mount('#app')

router.beforeEach((to, from, next) => {
    app.$Progress.start()
    next()
})
router.afterEach((to, from) => {
    app.$Progress.finish()
})

but it doesn't show any progress bar, it works fine when I use it components as this.$Progress, any help would be highly appreciated

Uncaught TypeError: dataFn is not a function

main.js

import VueProgressBar from 'vue-progressbar'

Vue.use(VueProgressBar, {
  color: 'rgb(143, 255, 199)',
  failedColor: 'red',
  height: '2px'
})

App.vue

<template>
     <vue-progress-bar></vue-progress-bar>
</template>

ChildComponent.vue

this.$Progress.start()
this.$http.post('api/', this.parseData(sysAppList)).then(res => {
  this.sysAppList = JSON.parse(res.data).data.list
  this.hostApp = this.sysAppList.length > 0 ? this.sysAppList[0].instanceId : ''
  this.$Progress.finish()
})

Error raised by vue.common.js says: Uncaught TypeError: dataFn is not a function

Detect progress

Is there any way to detect if the progress bar is already "start" "in progress" or "running" in the event that something triggers the progress bar start multiple times?

Usage without module / exports / RequireJS/AMD

It would be nice if you could add a fallback for a regular JavaScript usage with <script src="/js/vue-progressbar.js"></script> - meaning without any AMD loading / gulp/grunt preprocessing or ES6 features (like for IE10, Mobile Safari on iOS 9/10) ? Seems like its dependent on the module.export

Problem with `Meteor + Vue-Meteor`?

I tried to use this on Meteor + Vue-Meteor.

import VueProgressBar from 'vue-progressbar';
Vue.use(VueProgressBar);

Get error

modules-runtime.js?hash=2b888cb…:133 Uncaught Error: Cannot find module './vue-progressbar.vue'
    at require (modules-runtime.js?hash=2b888cb…:133)
    at meteorInstall.node_modules.vue-progressbar.vue-progressbar.es5.js (printer.js:170)
    at fileEvaluate (modules-runtime.js?hash=2b888cb…:207)
    at Module.require (modules-runtime.js?hash=2b888cb…:130)
    at Module.Mp.importSync (printer.js:170)
    at meteorInstall.imports.startup.client.index.js (index.js:1)
    at fileEvaluate (modules-runtime.js?hash=2b888cb…:207)
    at Module.require (modules-runtime.js?hash=2b888cb…:130)
    at Module.Mp.importSync (printer.js:170)
    at meteorInstall.client.main.js (main.js:1)

Progress Bar for routes not working

in documentation

{ path: '/achievement', name: 'achievement', component: './components/Achievement.vue', meta: { progress: { func: [ {call: 'color', modifier: 'temp', argument: '#ffb000'}, {call: 'fail', modifier: 'temp', argument: '#6e0000'}, {call: 'location', modifier: 'temp', argument: 'top'}, {call: 'transition', modifier: 'temp', argument: {speed: '1.5s', opacity: '0.6s', termination: 400}} ] } } }

my code:

{ path: '/', name: 'profile', component: require('./components/Profile.vue'), meta: { progress: { func: [ {call: 'color', modifier: 'temp', argument: '#e2cc1f'}, {call: 'fail', modifier: 'temp', argument: '#e2cc1f'}, {call: 'location', modifier: 'temp', argument: 'top'}, {call: 'transition', modifier: 'temp', argument: {speed: '1.5s', opacity: '1.6s', termination: 400}} ] } } }

Error <style scoped> ^

Hello,

First tks for your work :)

I get this error:

<style scoped>
^

When I run Gulp.

doc typo

install via yarn should be

yarn add vue-progressbar

Problem testing with and VuePrograssBar

I'm having a problem testing with Avoriaz my own generic component that wraps a plugin called VuePrograssBar (http://hilongjw.github.io/vue-progressbar/)

I'm trying to test that my own generic component (Loading) is indeed calling the VuePrograssBar plugin.

Loading Component:

<template>
  <vue-progress-bar/>
</template>

<script>
  export default {
    name: 'loading',
    created() {
      this.$router.beforeEach((to, from, next) => {
        this.$Progress.start();
        next();
      });

      this.$router.afterEach(() => {
        this.$Progress.finish();
      });
    },
  };
</script>

My Test (Mocha, Chai, Avoriaz):

import { shallow } from 'avoriaz';

import Vue from 'vue';
import router from '@/router';
import Loading from '@/components/Loading';
import VueProgressBar from 'vue-progressbar';

describe('Loading.vue', () => {
  let wrapper;

  beforeEach(() => {
    Vue.use(VueProgressBar);
    wrapper = shallow(Loading, { router });
  });

  describe.only('Rendering', () => {
    it('should render a Loading component', () => {
      expect(wrapper.contains()).to.equal(true);
    });
  });
});

But I'm getting this error:

✗ should render a Loading component
[avoriaz]: wrapper.contains() must be passed a valid CSS selector or a Vue constructor
error@webpack:///~/avoriaz/dist/avoriaz.js:134:0 <- index.js:12227:45
contains@webpack:///~/avoriaz/dist/avoriaz.js:169:0 <- index.js:12262:10
webpack:///test/unit/specs/components/Loading.spec.js:22:13 <- index.js:24064:30

when finish looks like is rollback

in vue2 when finish then the progress will from 100 to 0
so will looks like is rollback (100 99 98 97 ..... 0)

can you first window.VueProgressBarEventBus.RADON_LOADING_BAR.options.show=false
then run your this.$vm.RADON_LOADING_BAR.percent = 0

i think this is good work for us thanks~~

„Did you register the component correctly?”

Hi!

I use your component and it works great, but I have an warn/error in browser console:

[Vue warn]: Unknown custom element: <vue-progress-bar> 
- did you register the component correctly?
For recursive components, make sure to provide the "name" option. 
(found in <App> at /Users/lukaszflorczak/Projekty/ns/src/App.vue)

What should I do?

Disable auto-finish

This plugin seems to automatically finish the progress after a certain amount of time, regardless of whether finish() was actually called or not. Other plugins, like angular-loading-bar are different int that respect. They start the progress and get slower the closer they get to the end. Also, they never complete if not explicitly finished. Can this be implemented in vue-progressbar as well?

Or am I overlooking something and this is already possible?

Uglify Error

File vue-progressbar.es5.js

2016-11-02 3 07 35

This is ES6 feature,make Uglify SyntaxError

Link to CDN?

How do I use this library in my webpages ?
Usually I have been adding the link to cdn in my webpages for different things like
Vue, and Vue-resource. but for this I can't seem to find the link

Customisable Position?

I don't want the progress-bar to be at the very top of my page but rather wherever i place it in the html, for instance under my main header on my webpage.

Is this possible?

Just wanted to compliment you

Really nice plugin.

  • Great addition to almost any Vue site.
  • Well documented.
  • ES6.
  • Maintained.

Thank you so much for your work on this.

Could I use this out of Vue Component?

I base on Meteor.
I check Progressbar on Meteor Startup

import VueProgressBar from 'vue-progressbar'

Meteor.startup(() => {
  // Before each
  router.beforeEach((to, from, next) => {
    VueProgressBar.start()

    if (!to.meta.notRequiresAuth) {
      // Check user
      if (!Meteor.loggingIn() && !Meteor.userId()) {
        next({ path: '/login' })
      } else {
        next()
      }
    } else {
      next()
    }
  })

  // // After each
  router.afterEach((to, from) => {
    VueProgressBar.finish()
  })

  // Start the vue app
  new Vue({
    router,
    store,
    ...AppLayout,
  }).$mount('app')
})

Bc I use check router hook in App Layout don't work

Please add TypeScript definitions

It would be great if this plugin was usable in typescript projects!
Consider adding it so it can be installed via (@)types/vue-progressbar

npm

Could you publish new version on npm?

Thanks :)

Anyway to use with beforeRouteEnter on a Component?

beforeRouteEnter doesn't have access to 'this'

I was hoping for Vue.$Progress.start(), but that doesn't work.
Anyway to access $Progress within beforeRouteEnter inside a component?
Anyway to access $Progress from Vue?

Ex.

beforeRouteEnter (to, from, next) {
	Vue.$Progress.start()
	setTimeout(() => {
		Vue.$Progress.finish()
		next()
	}, 3000)
},

Error when evaluating expression

i follow the documentation but i have this error:

vue.common.js?e881:1019[Vue warn]: Error when evaluating expression "{
'width': progress.percent+'%',
'height': progress.options.height,
'background-color': progress.options.canSuccess? progress.options.color : progress.options.failedColor,
'opacity': progress.options.show ? 1 : 0
}": TypeError: Cannot read property 'percent' of undefined (found in component: )

Getting DOMException [NotFoundError: "Node was not found"

I implemented vue-progress but when i switch between routes I get the following error

DOMException [NotFoundError: "Node was not found"

Routes

export default [
    {path: "/",name:"home", component: (resolve) => { require(["../components/views/home.vue"], resolve)}, },
    {path: ":referral",name:"home", component: (resolve) => { require(["../components/views/home.vue"], resolve)} },
    {path: "/404",name:"404", component: (resolve) => { require(["../components/views/404.vue"], resolve)}},
    {path: "/403",name:"403", component: (resolve) => { require(["../components/views/403.vue"], resolve)}},
    {path: "/contact",name:"contact", component: (resolve) => { require(["../components/views/contact.vue"], resolve)} },
    {path: "/contact/:referral",name:"contact", component: (resolve) => { require(["../components/views/contact.vue"], resolve)} },
    {path: "/privacy/:referral",name:"privacy", component: (resolve) => { require(["../components/views/privacy.vue"], resolve)} },
    {path: "/privacy",name:"privacy", component: (resolve) => { require(["../components/views/privacy.vue"], resolve)} },
    {path: "/terms",name:"terms", component: (resolve) => { require(["../components/views/terms.vue"], resolve)} },
    {path: "/terms/:referral",name:"terms", component: (resolve) => { require(["../components/views/terms.vue"], resolve)} },
    {path: "/signupplan",name:"supplan", component: (resolve) => { require(["../components/views/singupplans.vue"], resolve)} },
    {path: "/signupplan/:referral",name:"supplan", component: (resolve) => { require(["../components/views/singupplans.vue"], resolve)} },
    {path: "/faq",name:"faq",component: (resolve) => { require(["../components/views/faq.vue"], resolve)} },
    {path: "/faq/:referral",name:"faq",component: (resolve) => { require(["../components/views/faq.vue"], resolve)} },
    {path: "/signup/:referral",name:"signp", component: (resolve) => { require(["../components/views/users/signinup.vue"], resolve)} }
]

app.vue

<template>
    <div>
        <router-view></router-view>
        <vue-progress-bar></vue-progress-bar>
    </div>
</template>

<style>
    @import '../../css/load.css';
     body{
         height:100%;
     }
    .mdl-layout-login {
        align-items: center;
        justify-content: center;
    }
    .mdl-layout__content-login {
        padding: 24px;
        flex: none;
    }

</style>

<script>
    export default {
        mounted () {
            //  [App.vue specific] When App.vue is finish loading finish the progress bar
            this.$Progress.finish()
        },
        created () {
            //  [App.vue specific] When App.vue is first loaded start the progress bar
            this.$Progress.start()
            //  hook the progress bar to start before we move router-view
            this.$router.beforeEach((to, from, next) => {
                //  does the page we want to go to have a meta.progress object
                if (to.meta.progress !== undefined) {
                let meta = to.meta.progress
                // parse meta tags
                this.$Progress.parseMeta(meta)
            }
            //  start the progress bar
            this.$Progress.start()
            //  continue to next page
            next()
        })
            //  hook the progress bar to finish after we've finished moving router-view
            this.$router.afterEach((to, from) => {
                //  finish the progress bar
                this.$Progress.finish()
        })
        }
    }
</script>

Libraries

    "@websanova/vue-auth": "^2.11.0-beta",
    "axios": "^0.15.3",
    "babel-core": "^6.24.1",
    "babel-eslint": "^7.2.1",
    "babel-loader": "^6.4.1",
    "babel-plugin-transform-object-rest-spread": "^6.23.0",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-2": "^6.24.1",
    "bootstrap-sass": "^3.3.7",
    "css-loader": "^0.23.0",
    "dropzone": "^4.3.0",
    "file-loader": "^0.9.0",
    "gulp": "^3.9.1",
    "image-webpack-loader": "^3.3.0",
    "jimp": "^0.2.27",
    "jquery": "^3.1.0",
    "laravel-elixir": "^6.0.0-9",
    "laravel-elixir-vue-2": "^0.2.0",
    "laravel-elixir-webpack-official": "^1.0.2",
    "lodash": "^4.16.2",
    "material-design-lite": "^1.3.0",
    "path": "^0.12.7",
    "responsive-loader": "^0.7.0",
    "style-loader": "^0.13.0",
    "svg-url-loader": "^1.1.0",
    "url-loader": "^0.5.8",
    "v-qrcode": "^1.0.3",
    "vee-validate": "^1.0.0-beta.10",
    "vue": "^2.2.6",
    "vue-axios": "^1.2.2",
    "vue-hot-reload-api": "^2.0.11",
    "vue-html-loader": "1.2.3",
    "vue-lazyload": "^1.0.3",
    "vue-loader": "^11.3.4",
    "vue-mdl": "^1.1.1",
    "vue-progressbar": "^0.7.2",
    "vue-qrcode-component": "^2.1.1",
    "vue-resource": "^1.3.1",
    "vue-router": "^2.4.0",
    "vue-scrollto": "^2.4.2",
    "vue-strap": "^1.0.11",
    "vue-style-loader": "^1.0.0",
    "vue-template-compiler": "^2.2.6",
    "vue2-dropzone": "^2.2.6",
    "vuelidate": "^0.2.0",
    "vuex": "^2.3.0",
    "webpack": "^2.3.3",
    "webpack-dev-server": "^1.16.1"

app.js

import Vue from 'vue'
import VueQRCodeComponent from 'vue-qrcode-component'
import VueResource from 'vue-resource'
import VueRouter from 'vue-router'
import VueAuth from '@websanova/vue-auth'
import VueProgressBar from 'vue-progressbar'
import App from './components/app.vue'
import mdl from 'material-design-lite'
import VueMdl from 'vue-mdl'
import VueX from 'vuex'
import axios from 'axios'
import VueAxios from 'vue-axios'
import VueScollTo from 'vue-scrollto'
import VueLazyload from 'vue-lazyload'
import VeeValidate from 'vee-validate'




Vue.use(VueRouter);
Vue.use(VueResource);
Vue.use(VeeValidate);
Vue.use(VueMdl);
Vue.use(VueAxios, axios);
Vue.use(VueScollTo);

const options = {
    color: '#bffaf3',
    failedColor: '#874b4b',
    thickness: '5px',
    transition: {
        speed: '0.2s',
        opacity: '0.6s',
        termination: 300
    },
    autoRevert: true,
    location: 'left',
    inverse: false
}

Vue.use(VueProgressBar, options)




/*Import Routes */
import siteRoutes from './routes/site'
import adminRoutes from './routes/adminroutes'
import userRoutes from './routes/userroutes'


/*Define Routes Object */
const loadRoutes = [
    ...siteRoutes
];

/*Define Router */
const router = new VueRouter({
    hashbang: false,
    linkActiveClass: 'active',
    mode: 'history',
    routes:loadRoutes
});

Vue.router = router;
/*End Define Router */


Vue.use(VueLazyload, {
    preLoad: 1.3,
    error: '/images/loose/loader-error.svg',
    loading: '/images/loose/loader.svg',
    attempt: 5,
    listenEvents: [ 'scroll' ]
})



// register custom select
Vue.component('select-c', require('./components/custom/select.vue'));

/*Register Dropzone */
Vue.component('dropzone', require('./components/custom/dropzonetwo.vue'));

/*QrCode */
Vue.component('qr-code', VueQRCodeComponent);



/*CRFC TOKEN For form validations */
Vue.http.headers.common['X-CSRF-TOKEN'] = document.querySelector('#token').getAttribute('content');

Vue.http.options.root="";




Vue.use(VueAuth,{
    authRedirect:'/',
    auth: require('@websanova/vue-auth/drivers/auth/bearer.js'),
    http: require('@websanova/vue-auth/drivers/http/vue-resource.1.x.js'),
    router: require('@websanova/vue-auth/drivers/router/vue-router.2.x.js'),
    token: [{request: 'token', response: 'token', authType: 'bearer', foundIn: 'header'}],
    tokenName:'token',
    loginData: {url: '/api/auth', method: 'POST', redirect: 'dashboard'},
    logoutData: {url: '/api/logout', method: 'POST', redirect: 'login',  makeRequest: false},
    fetchData: {url: '/api/account', method: 'GET' , authType: 'bearer',enabled: true},
    rolesVar: 'role_id',
    refreshData: {enabled: false}
});


const app = new Vue({
    router,
    ...App
})

app.$mount('#app');

Feature Request: Pause Progress

Hi,
I have some use-cases for when a task takes quite a bit of time and the progress bar gets to the end before the task is actually complete and before I have asked it to $Progress.finish().
Could we possibly pause it at say a certain percentage for such cases and then finish it upon completion of task?

The progressbar animation doesn't stop.

After using the method this.$Progressbar.finish(), the animation doesn't stop and it's my problem when I use your library.

You can see the image for more details: http://d.pr/i/qivNC.

Thank you for working on porting the progressbar to use with Vue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.