layout switch fix

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

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

Loading…
Cancel
Save