|
1 | 1 | <template> |
2 | | - <div class="layout" :class="{ hideSidebar: isSidebar }"> |
3 | | - <div class="layout-sidebar-left"> |
4 | | - <layout-sidebar/> |
5 | | - </div> |
6 | | - <div class="layout-right"> |
7 | | - <layout-navbar v-on:sidebar="toggleClick"/> |
| 2 | + <div class="wrapper skin-red" :class="{ hideSidebar: isSidebar }"> |
| 3 | + <layoutHeader v-on:sidebar="toggleClick"/> |
| 4 | + <layoutSidebar/> |
| 5 | + <div class="layout-main"> |
8 | 6 | <layout-breadcrumb/> |
9 | 7 | <layout-content/> |
10 | 8 | <layout-footer/> |
11 | 9 | </div> |
12 | 10 | </div> |
13 | 11 | </template> |
14 | 12 | <script> |
| 13 | + import layoutHeader from './Layout/Header.vue' |
15 | 14 | import layoutSidebar from './Layout/Sidebar.vue' |
16 | | - import layoutNavbar from './Layout/Navbar.vue' |
17 | 15 | import layoutBreadcrumb from './Layout/Breadcrumb.vue' |
18 | 16 | import layoutContent from './Layout/Content.vue' |
19 | 17 | import layoutFooter from './Layout/Footer.vue' |
20 | 18 | export default { |
21 | 19 | name: 'layout', |
22 | 20 | components: { |
| 21 | + layoutHeader, |
23 | 22 | layoutSidebar, |
24 | | - layoutNavbar, |
25 | 23 | layoutBreadcrumb, |
26 | 24 | layoutContent, |
27 | 25 | layoutFooter |
|
42 | 40 | @import './../assets/sass/mixin.scss'; |
43 | 41 | body{ |
44 | 42 | margin: 0; |
45 | | - } |
46 | | - .layout{ |
47 | 43 | background: #f5f7f9; |
48 | | - position: relative; |
49 | | - overflow: hidden; |
50 | | - display: -webkit-box; |
| 44 | + } |
| 45 | + a{ |
| 46 | + text-decoration: none; |
| 47 | + } |
| 48 | + .wrapper{ |
| 49 | + display: -webkit-flex; |
| 50 | + display: flex; |
| 51 | + flex-direction: column; |
51 | 52 | /* 收缩侧栏后的样式begin */ |
52 | 53 | &.hideSidebar { |
53 | | - >.layout-sidebar-left { |
54 | | - width: 50px; |
55 | | - >.sidebar-container { |
56 | | - >.el-menu--dark { |
57 | | - >.el-submenu{ |
58 | | - >.el-submenu__title{ |
59 | | - >span{ |
60 | | - display: none; |
61 | | - } |
62 | | - >.el-submenu__icon-arrow{ |
63 | | - display: none; |
64 | | - } |
65 | | - display: -webkit-box; |
66 | | - } |
67 | | - >.el-menu{ |
68 | | - display: none !important; |
69 | | - } |
70 | | - &:hover{ |
71 | | - >.el-submenu__title{ |
72 | | - >span{ |
73 | | - margin-left: 22px; |
74 | | - -moz-box-flex:1.0; |
75 | | - -webkit-box-flex: 1.0; |
76 | | - display: block; |
77 | | - } |
78 | | - >.el-submenu__icon-arrow{ |
79 | | - padding-top: 5px; |
80 | | - display: block; |
81 | | - } |
82 | | - background-color: #222d32; |
83 | | - width: 230px; |
84 | | - border-top-right-radius: 4px; |
85 | | - } |
86 | | - >.el-menu{ |
87 | | - display: block !important; |
88 | | - position: absolute; |
89 | | - width: 180px; |
90 | | - left: 50px; |
91 | | - padding-top: 5px; |
92 | | - padding-bottom: 5px; |
93 | | - border-bottom-right-radius: 4px; |
94 | | - } |
95 | | - } |
96 | | - } |
97 | | - overflow-x:visible; |
| 54 | + >.main-header{ |
| 55 | + >.logo{ |
| 56 | + width: 50px; |
| 57 | + min-width: 50px; |
| 58 | + >.logo-mini{ |
| 59 | + display: block; |
98 | 60 | } |
99 | | - >.layout-logo-lg{ |
| 61 | + >.logo-lg{ |
100 | 62 | display: none; |
101 | 63 | } |
102 | | - >.layout-logo-mini{ |
103 | | - display: block; |
| 64 | + } |
| 65 | + } |
| 66 | + >.sidebar-menu { |
| 67 | + width:50px; |
| 68 | + overflow-x:visible; |
| 69 | + >.el-submenu{ |
| 70 | + >.el-submenu__title{ |
| 71 | + >span{ |
| 72 | + display: none; |
| 73 | + } |
| 74 | + >.el-submenu__icon-arrow{ |
| 75 | + display: none; |
| 76 | + } |
| 77 | + display: -webkit-box; |
104 | 78 | } |
105 | | - >.sidebar-menu { |
106 | | - width:50px; |
| 79 | + >.el-menu{ |
| 80 | + display: none !important; |
| 81 | + } |
| 82 | + &:hover{ |
| 83 | + >.el-submenu__title{ |
| 84 | + >span{ |
| 85 | + margin-left: 22px; |
| 86 | + -moz-box-flex:1.0; |
| 87 | + -webkit-box-flex: 1.0; |
| 88 | + display: block; |
| 89 | + } |
| 90 | + >.el-submenu__icon-arrow{ |
| 91 | + padding-top: 5px; |
| 92 | + display: block; |
| 93 | + } |
| 94 | + background-color: #222d32; |
| 95 | + width: 230px; |
| 96 | + border-top-right-radius: 4px; |
| 97 | + } |
| 98 | + >.el-menu{ |
| 99 | + display: block !important; |
| 100 | + position: absolute; |
| 101 | + width: 180px; |
| 102 | + left: 50px; |
| 103 | + padding-top: 5px; |
| 104 | + padding-bottom: 5px; |
| 105 | + border-bottom-right-radius: 4px; |
| 106 | + } |
107 | 107 | } |
108 | 108 | } |
109 | 109 | } |
| 110 | + >.layout-main{ |
| 111 | + margin-left: 50px; |
| 112 | + } |
110 | 113 | } |
111 | 114 | /* 收缩侧栏后的样式end */ |
112 | 115 | } |
113 | | - .layout-sidebar-left{ |
114 | | - width: 230px; |
115 | | - transition: transform .3s ease-in-out,width .3s ease-in-out; |
| 116 | + .layout-main{ |
| 117 | + flex: 1 0 auto; |
| 118 | + display: -webkit-flex; |
| 119 | + display: flex; |
| 120 | + flex-direction: column; |
| 121 | + margin-left: 230px; |
| 122 | + transition: margin-left 0.3s ease-in-out; |
116 | 123 | } |
117 | | - .layout-right{ |
118 | | - -moz-box-flex:1.0; |
119 | | - -webkit-box-flex: 1.0; |
120 | | - width: 100%; |
| 124 | + .skin-red{ |
| 125 | + >.main-header{ |
| 126 | + >.logo{ |
| 127 | + background-color: #d73925; |
| 128 | + color: #fff; |
| 129 | + border-bottom: 0 solid transparent; |
| 130 | + } |
| 131 | + >.navbar{ |
| 132 | + background-color: #dd4b39; |
| 133 | + >.menu-navbar{ |
| 134 | + background-color: #dd4b39; |
| 135 | + } |
| 136 | + } |
| 137 | + } |
| 138 | + } |
| 139 | +
|
| 140 | + @media (max-width: $screen-xs-max) { |
| 141 | + .sidebar-menu{ |
| 142 | + transform: translate(-230px, 0); |
| 143 | + } |
| 144 | + .layout-main{ |
| 145 | + margin-left: 0; |
| 146 | + } |
121 | 147 | } |
122 | | - </style> |
| 148 | +</style> |
0 commit comments