inleft
2022-02-21 4b854c29227ef08ea178a3bba527a40ca2f84674
commit | author | age
ad2b70 1 <template>
41b36f 2     <div class="blog-container  ">
4b854c 3         <span class="blog-pigeonhole">
I 4             <router-link :to="{path:'/articleList'}">
5                 分类
6             </router-link>
7         </span>
ad2b70 8         <div class="blog-scroll ">
L 9             <div class="blog-log-list">
10                 <div class="blog-log-item" v-for="item in list1">
4b854c 11                     <router-link :to="{path:'/articleList',query:{typeId:item.id}}">
63af45 12                         <span>{{item.typeName}}</span>
56a4b8 13                     </router-link>
I 14
63af45 15                     <span>{{item.count==null?'--':item.count}}</span>
ad2b70 16                 </div>
L 17             </div>
18             <div class="blog-log-list">
19                 <div class="blog-log-item" v-for="item in list2">
4b854c 20                     <router-link :to="{path:'/articleList',query:{typeId:item.id}}">
63af45 21                         <span>{{item.typeName}}</span>
56a4b8 22                     </router-link>
63af45 23                     <span>{{item.count==null?'--':item.count}}</span>
56a4b8 24
ad2b70 25                 </div>
L 26             </div>
27         </div>
28     </div>
29
30 </template>
31
32 <script>
63af45 33     import {
I 34         queryBlogArticleType
35     } from '../../api/blogArticleType.js'
ad2b70 36     export default {
63af45 37         beforeMount() {
I 38             queryBlogArticleType({}).then((res) => {
4b854c 39                 this.list1 = res.data.slice(0, 3)
I 40                 this.list2 = res.data.slice(4)
63af45 41             })
I 42         },
ad2b70 43         data() {
L 44             return {
4b854c 45                 list1: [],
I 46                 list2: [],
63af45 47                 // list1: [{
I 48                 //     name: "日志",
49                 //     count: 10
50                 // }, {
51                 //     name: "分类",
52                 //     count: 12
53                 // }, {
54                 //     name: "标签",
55                 //     count: 14
56                 // }],
57                 // list2: [{
58                 //     name: "Tag",
59                 //     count: 133
60                 // }, {
61                 //     name: "专题",
62                 //     count: 10
63                 // }, {
64                 //     name: "偏好",
65                 //     count: 12
66                 // }, {
67                 //     name: "星标",
68                 //     count: 14
69                 // },{
70                 //     name: "Tag",
71                 //     count: 133
72                 // }, {
73                 //     name: "专题",
74                 //     count: 10
75                 // }, {
76                 //     name: "偏好",
77                 //     count: 12
78                 // }, {
79                 //     name: "星标",
80                 //     count: 14
81                 // },{
82                 //     name: "Tag",
83                 //     count: 133
84                 // }, {
85                 //     name: "专题",
86                 //     count: 10
87                 // }, {
88                 //     name: "偏好",
89                 //     count: 12
90                 // }, {
91                 //     name: "星标",
92                 //     count: 14
93                 // },{
94                 //     name: "Tag",
95                 //     count: 133
96                 // }, {
97                 //     name: "专题",
98                 //     count: 10
99                 // }, {
100                 //     name: "偏好",
101                 //     count: 12
102                 // }, {
103                 //     name: "星标",
104                 //     count: 14
105                 // }]
ad2b70 106             }
L 107         }
108     }
109 </script>
110
111 </script>
112
113 <style lang="less">
4b854c 114     .blog-pigeonhole {
I 115         a {
116             color: black;
117         }
118     }
119
ad2b70 120     /*日志部分*/
L 121     .blog-log-list {
122         line-height: 1.6;
123         padding-left: 3%;
124         padding-right: 3%;
125
126         flex-wrap: wrap;
127         /*让弹性盒元素在必要的时候拆行:*/
128         display: -webkit-flex;
129         display: flex;
130         -webkit-justify-content: center;
131         justify-content: center;
132     }
133
134     .blog-log-item {
135         border-left: 2px solid rgba(222, 229, 231, .45);
136         width: 23%;
137         margin-bottom: 10px;
138
139         :first-child {
140             border-left: none;
141         }
142
d629d9 143         a {
L 144             color: black;
145         }
146
56a4b8 147         .link span:first-child {
ad2b70 148             color: #999;
L 149         }
150
56a4b8 151         .link span:last-child {
ad2b70 152             font-weight: 600;
L 153             font-size: 15px;
154         }
155
156         span {
157             display: block;
158         }
159     }
160 </style>