Skip to content

Commit

Permalink
feat: add config default show progress when router change
Browse files Browse the repository at this point in the history
  • Loading branch information
hoanguyen committed Jul 6, 2021
1 parent f969a0e commit a514a52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/progressbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ export default {
return new Error('Vue version at least 3.0');
}

const config = Object.assign({ router: true }, options);
const global = app.config.globalProperties;
global.$Progressbar = VueProgressbar;
if (options.router && typeof window !== 'undefined' && global.$router) {
if (config.router && typeof window !== 'undefined' && global.$router) {
global.$router.beforeEach(() => {
global.$Progressbar.start();
});
Expand Down

0 comments on commit a514a52

Please sign in to comment.