AdminLayout.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="AdminLayout">
  3. <div v-if="breadcrumbsVisibility && false"
  4. class="q-mb-md">
  5. <q-skeleton v-if="!breadcrumbs.path"
  6. width="100px"
  7. height="10px" />
  8. <q-breadcrumbs v-else
  9. class="breadcrumbs"
  10. separator-color="dark"
  11. gutter="sm">
  12. <template v-slot:separator>
  13. <q-icon name="isax:arrow-right-3 " />
  14. </template>
  15. <q-breadcrumbs-el v-for="(breadcrumb, index) in breadcrumbs.path"
  16. :key="index"
  17. :icon=breadcrumb.icon
  18. :label=breadcrumb.title
  19. :to="getRoute(breadcrumb.route)"
  20. class="q-breadcrumbs-el">
  21. <q-skeleton v-if="breadcrumb.loading"
  22. width="100px"
  23. height="10px" />
  24. </q-breadcrumbs-el>
  25. </q-breadcrumbs>
  26. </div>
  27. <router :include="keepAliveComponents" />
  28. </div>
  29. </template>
  30. <script>
  31. import { mapGetters } from 'vuex'
  32. import Router from 'src/router/Router.vue'
  33. export default {
  34. components: { Router },
  35. data () {
  36. return {
  37. keepAliveComponents: []
  38. }
  39. },
  40. computed: {
  41. ...mapGetters('AppLayout', [
  42. 'breadcrumbsVisibility',
  43. 'breadcrumbs',
  44. 'breadcrumbLoading'
  45. ])
  46. },
  47. methods: {
  48. hasRoute (route) {
  49. if (!route) {
  50. return
  51. }
  52. return !!(route.name || route.path)
  53. },
  54. getRoute (route) {
  55. if (!this.hasRoute(route)) {
  56. return { name: null }
  57. }
  58. if (route.name) {
  59. return { name: route.name }
  60. } else if (route.path) {
  61. return { path: route.path }
  62. } else {
  63. return { name: null }
  64. }
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .AdminLayout {
  71. padding: 35px 35px 35px 61px;
  72. @media screen and (max-width: 1023px) {
  73. padding: 15px 10px !important;
  74. }
  75. }
  76. </style>