Layout.vue 1001 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div class="app-wrapper" :class="classObj">
  3. <sidebar class="sidebar-container"></sidebar>
  4. <div class="main-container">
  5. <navbar></navbar>
  6. <app-main></app-main>
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. import { Navbar, Sidebar, AppMain } from './components'
  12. import ResizeMixin from './mixin/ResizeHandler'
  13. export default {
  14. name: 'layout',
  15. components: {
  16. Navbar,
  17. Sidebar,
  18. AppMain
  19. },
  20. mixins: [ResizeMixin],
  21. computed: {
  22. sidebar() {
  23. return this.$store.state.app.sidebar
  24. },
  25. device() {
  26. return this.$store.state.app.device
  27. },
  28. classObj() {
  29. return {
  30. hideSidebar: !this.sidebar.opened,
  31. withoutAnimation: this.sidebar.withoutAnimation,
  32. mobile: this.device === 'mobile'
  33. }
  34. }
  35. }
  36. }
  37. </script>
  38. <style rel="stylesheet/scss" lang="scss" scoped>
  39. @import "src/styles/mixin.scss";
  40. .app-wrapper {
  41. @include clearfix;
  42. position: relative;
  43. height: 100%;
  44. width: 100%;
  45. }
  46. </style>