beb2cbcbb85324bc68819a6104e9adfe39c31dfc.svn-base 604 B

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