layout switch fix

pull/1/head
Thomas Ballmann 3 years ago
parent 9c75d1b201
commit fa4f4bbbbb

@ -32,30 +32,18 @@
},
data: () => ({
isLoading: true,
layout: 'layout-default',
}),
computed: {
...mapState(['stats']),
layout () {
return 'layout-' + (this.$route.meta.layout || 'default')
},
},
created () {
// switch layout if necessary
this.$router.beforeEach((to, from, next) => {
const layout = to.meta.layout || 'default'
this.layout = 'layout-' + layout
next()
})
// load
Promise.all([this.loadStats(), this.loadSettings()]).then((values) => {
this.isLoading = false
})
/*
this.loadStats().then(() => {
Promise.all([this.loadStats(), this.loadSettings()]).then(() => {
this.isLoading = false
})
*/
},
methods: {
...mapActions([

Loading…
Cancel
Save