lijh
2022-01-12 bf6fbec0b5593eb28dc195a58a4208d29b79dfee
commit | author | age
bf6fbe 1 <template>
L 2     <div id="components-layout-basic">
3         <a-layout>
4             <a-layout-header>Header</a-layout-header>
5             <a-layout>
6                 <div class="blog-main">
7                     <a-row type="flex" justify="space-around" align="middle">
8                         <a-col v-bind="colApiLeft">
9                             <boxLeft></boxLeft>
10                         </a-col>
11                         <a-col v-bind="colApiMain">
12                             <box1></box1>
13                         </a-col>
14                         <a-col v-bind="colApiRight">
15                             <boxRight></boxRight>
16                         </a-col>
17                     </a-row>
18                 </div>
19                 <!-- <a-layout-sider v-bind="sliderApi">Sider</a-layout-sider>
20                 <a-layout-content>Content</a-layout-content>
21                 <a-layout-sider v-bind="sliderApi">Sider</a-layout-sider> -->
22             </a-layout>
23             <a-layout-footer>Footer</a-layout-footer>
24         </a-layout>
25     </div>
26 </template>
27
28 <script>
29     import boxLeft from "./boxLeft.vue"
30     import boxRight from "./boxRight.vue"
31     import box1 from "./box1.vue"
32     export default {
33         components: {
34             boxLeft,
35             boxRight,
36             box1
37         },
38         data() {
39             return {
40                 sliderApi: {
41                     collapsible: true, //是否可收起
42
43                     collapsedWidth: 0 //收缩宽度,设置为 0 会出现特殊 trigger
44                 },
45                 colApiLeft: {
46                     xs: 0,
47                     sm: 0,
48                     md: 0,
49                     lg: 8,
50                     xl: 8,
51                     xxl: 6,
52                 },
53                 colApiRight: {
54                     xs: 0,
55                     sm: 0,
56                     md: 0,
57                     lg: 0,
58                     xl: 0,
59                     xxl: 4,
60                 },
61                 colApiMain: {
62                     xs: 24,
63                     sm: 24,
64                     md: 24,
65                     lg: 14,
66                     xl: 14,
67                     xxl: 14,
68                 }
69             }
70         }
71     }
72 </script>
73
74 <style lang="less">
75     .blog-main {
76         padding-left: 5%;
77         padding-right: 5%;
78     }
79
80     #components-layout-basic {
81         text-align: center;
82         height: 100%;
83         width: 100%;
84         margin: 0;
85         padding: 0;
86
87         .ant-layout-header,
88         .ant-layout-footer {
89             background: #7dbcea;
90             color: #fff;
91         }
92
93         .ant-layout-footer {
94             line-height: 1.5;
95         }
96
97         .ant-layout-sider {
98             background: #3ba0e9;
99             color: #fff;
100             line-height: 120px;
101         }
102
103         .ant-col,
104         .ant-layout-content {
105             // background: rgba(16, 142, 233, 1);
106             // color: #fff;
107             line-height: 120px;
108             height: 100%;
109         }
110
111         >.ant-layout {
112             width: 100%;
113             min-height: 100%;
114         }
115
116         >.ant-layout:last-child {
117             margin: 0;
118         }
119     }
120     
121     
122         .h1,
123         .h2,
124         .h3,
125         .h4,
126         .h5,
127         .h6,
128         h1,
129         h2,
130         h3,
131         h4,
132         h5,
133         h6 {
134             font-weight: 400;
135         }
136     
137         span,
138         p {
139             font-size: 17px;
140             letter-spacing: 0.8px;
141             line-height: 30px;
142         }
143     
144         .fadeInLeft {
145             -webkit-animation-name: "fadeInLeft";
146             -webkit-animation-duration: 1s;
147             -webkit-animation-iteration-count: 1;
148         }
149     
150         .fadeInRight {
151             -webkit-animation-name: "fadeInRight";
152             -webkit-animation-duration: 1s;
153             -webkit-animation-iteration-count: 1;
154         }
155     
156         /*左右两边的盒子容器*/
157         .blog-cell-main-container {
158             opacity: 0.8;
159             padding: 0px 25px 10px;
160         }
161     
162         /*左边部分*/
163         .blog-left-side-portion {
164             position: sticky;
165             top: 80px;
166             padding-left: 2%;
167             /*padding-right: 2%;*/
168             z-index: 100;
169         }
170     
171     
172         /*---------------------
173         |   核心盒子构成start   |
174         ------- ---------------*/
175         .blog-left-side-scroll-portion,
176         .blog-right-side-container {
177             border-radius: 15px;
178             background-color: white;
179     
180             line-height: 1.4;
181             white-space: nowrap;
182             /*规定段落中的文本不进行换行:*/
183             text-align: center;
184             padding-top: 20px;
185             padding-bottom: 20px;
186             max-height: 200px;
187             /*margin-top: 10px;*/
188             /*min-height: 200px;*/
189     
190             overflow-x: hidden;
191             overflow-y: auto;
192             display: block;
193         }
194     
195     
196         /*预留滚动条的宽度*/
197         .blog-left-side-scroll-portion,
198         .blog-right-side-scroll-portion {
199             padding-right: 5px;
200         }
201     
202         /*预留滚动条的宽度 缩减*/
203         .blog-left-side-scroll-portion:hover,
204         .blog-right-side-scroll-portion:hover {
205             padding-right: 0px;
206         }
207     
208         .blog-left-side-scroll-portion:hover::-webkit-scrollbar {
209             display: block;
210         }
211     
212         .blog-right-side-scroll-portion:hover::-webkit-scrollbar {
213             display: block;
214         }
215     
216         .blog-left-side-scroll-portion::-webkit-scrollbar,
217         .blog-right-side-scroll-portion::-webkit-scrollbar {
218             width: 5px;
219             display: none;
220         }
221     
222         .blog-left-side-scroll-portion::-webkit-scrollbar-thumb,
223         .blog-right-side-scroll-portion::-webkit-scrollbar-thumb {
224             background-color: rgba(153, 154, 170, 0.3);
225             border-radius: 2px;
226         }
227     
228         /*margin滚动条上偏移*/
229         .blog-left-side-scroll-portion::-webkit-scrollbar-track,
230         .layui-layer-content::-webkit-scrollbar-track {
231             margin-top: 20px;
232             margin-bottom: 20px;
233         }
234
235
236     // 动画
237     @-webkit-keyframes fadeInLeft {
238         0% {
239             opacity: 0;
240             -webkit-transform: translateX(-120px);
241         }
242
243         100% {
244             opacity: 1;
245             -webkit-transform: translateX(0);
246         }
247     }
248
249     @keyframes fadeInLeft {
250         0% {
251             opacity: 0;
252             transform: translateX(-120px);
253         }
254
255         100% {
256             opacity: 1;
257             transform: translateX(0);
258         }
259     }
260
261     @-webkit-keyframes fadeInRight {
262         0% {
263             opacity: 0;
264             -webkit-transform: translateX(120px);
265         }
266
267         100% {
268             opacity: 1;
269             -webkit-transform: translateX(0);
270         }
271     }
272
273     @keyframes fadeInRight {
274         0% {
275             opacity: 0;
276             transform: translateX(120px);
277         }
278
279         100% {
280             opacity: 1;
281             transform: translateX(0);
282         }
283     }
284
285     @-webkit-keyframes fade {
286         0% {
287             opacity: 0;
288         }
289
290         100% {
291             opacity: 1;
292         }
293     }
294
295     @keyframes fade {
296         0% {
297             opacity: 0;
298         }
299
300         100% {
301             opacity: 1;
302         }
303     }
304 </style>