Created
April 21, 2018 04:33
-
-
Save andreasvirkus/00708d73c9c42d68034ad861f2610855 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nprogress from 'nprogress' | |
export default { | |
// ... | |
// configure progress bar | |
nprogress.configure({ showSpinner: false }) | |
this.$router.beforeEach((to, from, next) => { | |
if (to.path !== from.path && !Vue.component(pathToComponentName(to.path))) { | |
nprogress.start() | |
} | |
next() | |
}) | |
this.$router.afterEach(() => { | |
nprogress.done() | |
this.isSidebarOpen = false | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment