Blame view
src/views/dashboard/index.vue
565 Bytes
80a28914e
|
1 |
<template> |
d7d9c38c2
![]() |
2 3 |
<div class="dashboard-container"> <component :is="currentRole" /> |
80a28914e
|
4 5 6 7 |
</div> </template> <script> |
d7d9c38c2
![]() |
8 9 10 |
import { mapGetters } from 'vuex' import adminDashboard from './admin' import editorDashboard from './editor' |
80a28914e
|
11 12 |
export default { |
d7d9c38c2
![]() |
13 14 |
name: 'Dashboard', components: { adminDashboard, editorDashboard }, |
1172ebb79
![]() |
15 16 |
data() { return { |
d7d9c38c2
![]() |
17 18 |
currentRole: 'adminDashboard' } |
1172ebb79
![]() |
19 |
}, |
80a28914e
|
20 |
computed: { |
d7d9c38c2
![]() |
21 22 23 |
...mapGetters([ 'roles' ]) |
1172ebb79
![]() |
24 |
}, |
d7d9c38c2
![]() |
25 26 27 |
created() { if (!this.roles.includes('admin')) { this.currentRole = 'editorDashboard' |
1172ebb79
![]() |
28 |
} |
80a28914e
|
29 |
} |
1172ebb79
![]() |
30 |
} |
d7d9c38c2
![]() |
31 |
</script> |