AdminLayout.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <div class="AdminLayout">
  3. <router :include="keepAliveComponents" />
  4. </div>
  5. </template>
  6. <script>
  7. import Router from 'src/router/Router.vue'
  8. export default {
  9. components: { Router },
  10. data () {
  11. return {
  12. keepAliveComponents: []
  13. }
  14. },
  15. mounted () {
  16. if (typeof window !== 'undefined') {
  17. this.$store.commit('AppLayout/updateLayoutLeftDrawerVisible', window.screen.width > this.$q.screen.sizes.md)
  18. }
  19. },
  20. methods: {
  21. hasRoute (route) {
  22. if (!route) {
  23. return
  24. }
  25. return !!(route.name || route.path)
  26. },
  27. getRoute (route) {
  28. if (!this.hasRoute(route)) {
  29. return { name: null }
  30. }
  31. if (route.name) {
  32. return { name: route.name }
  33. } else if (route.path) {
  34. return { path: route.path }
  35. } else {
  36. return { name: null }
  37. }
  38. }
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .AdminLayout {
  44. background: #F9F9F9;
  45. padding: 35px 35px 35px 61px;
  46. @media screen and (max-width: 1023px) {
  47. padding: 15px 10px !important;
  48. }
  49. }
  50. </style>