inleft
2022-01-15 41b36f013d4103ffc59fd58feb6b6177ee5b04f7
commit | author | age
41b36f 1 <template>
I 2     <div class="blog-container archive">
3         <span class="blog-pigeonhole">
4             <router-link to="/tagTime?type=1">
5                 归档信息
6             </router-link>
7         </span>
8         <div class="blog-scroll ">
9             <div v-for="yearData in myData">
10                 <router-link to="/tagTime?type=2">
11                     <p class="blog-pigeonhole-p">{{yearData.year}}</p>
12                 </router-link>
13                 <div class="blog-pigeonhole-list">
14             
15                     <div class="blog-pigeonhole-item" v-for="item in yearData.list">
16                         <router-link to="/tagTime?type=3">
17                             <span>{{item.month}}月</span>
18                         </router-link>
19                         <span>{{item.count}}篇</span>
20             
21                     </div>
22                 </div>
23             </div>
24         </div>
25     </div>
26
27 </template>
28
29 <script>
30     export default {
31         data() {
32             return {
33                 "myData": [{
34                         "year": "2022",
35                         "list": [{
36                                 "month": "12",
37                                 "count": 10
38                             },
39                             {
40                                 "month": "10",
41                                 "count": 11
42                             },
43                             {
44                                 "month": "9",
45                                 "count": 9
46                             }
47                         ]
48                     },
49                     {
50                         "year": "2021",
51                         "list": [{
52                                 "month": "12",
53                                 "count": 8
54                             },
55                             {
56                                 "month": "10",
57                                 "count": 7
58                             },
59                             {
60                                 "month": "9",
61                                 "count": 6
62                             },
63                             {
64                                 "month": "8",
65                                 "count": 5
66                             },
67                             {
68                                 "month": "7",
69                                 "count": 4
70                             },
71                             {
72                                 "month": "6",
73                                 "count": 3
74                             },
75                             {
76                                 "month": "5",
77                                 "count": 2
78                             },
79                             {
80                                 "month": "4",
81                                 "count": 1
82                             }
83                         ]
84                     }
85                 ],
86             }
87         }
88     }
89 </script>
90
91 </script>
92
93 <style lang="less">
94     /*归档部分*/
95     .archive {
96         a {
97             color: black;
98         }
99     }
100
101     .blog-pigeonhole {
102         font-size: 15px;
103     }
104
105     .blog-pigeonhole-p {
106         width: 20%;
107         text-align: center;
108         line-height: 20px;
109         border-radius: 6px 6px 6px 6px;
110         /*background-color: #edf0f3;*/
111         margin-left: 3%;
112         margin-bottom: 3%;
113         opacity: 0.7;
114     }
115
116     .blog-pigeonhole-list {
117         line-height: 1.6;
118         padding-left: 3%;
119         padding-right: 3%;
120         /*display: flex; !*弹性盒子*!*/
121         /*justify-content: flex-end; !*在弹性盒对象的 <div> 元素中的各项周围留有空白:*!*/
122
123         display: flex;
124         display: -webkit-flex;
125         -webkit-justify-content: flex-start;
126         justify-content: flex-start;
127
128         flex-wrap: wrap;
129         /*让弹性盒元素在必要的时候拆行:*/
130         align-content: flex-start;
131         -webkit-align-content: flex-start;
132
133     }
134
135     .blog-pigeonhole-item {
136         min-width: 22%;
137         margin-left: 1.5%;
138         margin-right: 1.5%;
139         margin-bottom: 5%;
140
141         a span:first-child {
142             height: 22px;
143             background-color: #edf0f3;
144             border-radius: 6px 6px 0 0;
145             opacity: .8;
146             color: #999aaa;
147             line-height: 22px;
148             margin-bottom: 1px;
149             text-align: center;
150         }
151
152         a span:last-child {
153             height: 22px;
154             background-color: #f6f8fa;
155             border-radius: 0 0 6px 6px;
156             color: #555666;
157             line-height: 20px;
158             font-weight: 600;
159             text-align: center;
160         }
161
162         span {
163             display: block;
164         }
165     }
166 </style>