Skip to content

Instantly share code, notes, and snippets.

@andreasvirkus
Created April 21, 2018 04:33
Show Gist options
  • Save andreasvirkus/00708d73c9c42d68034ad861f2610855 to your computer and use it in GitHub Desktop.
Save andreasvirkus/00708d73c9c42d68034ad861f2610855 to your computer and use it in GitHub Desktop.
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