MainFrame.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div class="mainFrame">
  3. <el-container>
  4. <el-header>
  5. <navbar @collapseControl="Collapse"></navbar>
  6. </el-header>
  7. <el-container>
  8. <el-aside :width="isCollapse ? '64px' : '200px'">
  9. <sidebar :isCollapse="isCollapse"></sidebar>
  10. </el-aside>
  11. <el-container>
  12. <el-main>
  13. <router-view/>
  14. </el-main>
  15. </el-container>
  16. </el-container>
  17. </el-container>
  18. </div>
  19. </template>
  20. <script>
  21. import navbar from '@/layout/Navbar'
  22. import sidebar from '@/layout/Sidebar'
  23. export default {
  24. components: { navbar, sidebar },
  25. data() {
  26. return {
  27. isCollapse: '',
  28. }
  29. },
  30. methods: {
  31. Collapse(val) {
  32. this.isCollapse = val;
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="less" scoped>
  38. .mainFrame {
  39. width: 100%;
  40. height: 100%;
  41. }
  42. .el-container {
  43. height: 100%;
  44. overflow: hidden;
  45. }
  46. .el-header {
  47. left: 0px;
  48. top: 0px;
  49. height: 64px !important;
  50. line-height: 20px;
  51. background-image: url('@/assets/background/background@3x.png');
  52. text-align: center;
  53. box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.15);
  54. }
  55. .el-aside {
  56. left: 0px;
  57. top: 64px;
  58. color: rgba(16, 16, 16, 1);
  59. line-height: 20px;
  60. background-color: #266999;
  61. color: rgba(16, 16, 16, 1);
  62. font-size: 14px;
  63. text-align: center;
  64. overflow-x: hidden;
  65. transition: width 0.25s;
  66. -webkit-transition: width 0.25s;
  67. -moz-transition: width 0.25s;
  68. -o-transition: width 0.25s;
  69. }
  70. .el-main {
  71. background-color: #E9EEF3;
  72. color: #333;
  73. height: 100%;
  74. width: 100%;
  75. }
  76. </style>