mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-18 12:34:25 +08:00
fix: loading-bar theme when use os theme
This commit is contained in:
parent
57adc0940b
commit
6986bacf94
@ -6,7 +6,11 @@ export default function createRouter (Vue, routes) {
|
|||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
router.beforeEach(function (to, from, next) {
|
router.beforeEach(function (to, from, next) {
|
||||||
Vue.prototype.$NLoadingBar.theme = to.params.theme
|
let theme = to.params.theme
|
||||||
|
if (theme === 'os-theme') {
|
||||||
|
theme = Vue.prototype.$NOs.theme
|
||||||
|
}
|
||||||
|
Vue.prototype.$NLoadingBar.theme = theme
|
||||||
if (to.path !== from.path) {
|
if (to.path !== from.path) {
|
||||||
Vue.prototype.$NLoadingBar.start()
|
Vue.prototype.$NLoadingBar.start()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user