2021-02-11 21:31:41 +08:00

22 lines
439 B
JavaScript

import Vue from 'vue'
import nprogress from 'nprogress'
export default {
mounted () {
// configure progress bar
nprogress.configure({ showSpinner: false })
this.$router.beforeEach((to, from, next) => {
if (to.path !== from.path && !Vue.component(to.name)) {
nprogress.start()
}
next()
})
this.$router.afterEach(() => {
nprogress.done()
this.isSidebarOpen = false
})
}
}