inleft
2024-05-18 57e3bead08715d72efaeffe90fafa179b8366473
commit | author | age
ad2b70 1 <template>
41b36f 2     <div class="blog-container  ">
4b854c 3         <span class="blog-pigeonhole">
731926 4             <!-- <router-link :to="{path:'/articleList'}">
4b854c 5                 分类
731926 6             </router-link> -->
I 7             分类
4b854c 8         </span>
ad2b70 9         <div class="blog-scroll ">
L 10             <div class="blog-log-list">
fa1bd9 11                 <div class="blog-log-item" v-for="(item,index) in list1">
4b854c 12                     <router-link :to="{path:'/articleList',query:{typeId:item.id}}">
63af45 13                         <span>{{item.typeName}}</span>
56a4b8 14                     </router-link>
I 15
63f511 16                     <span>{{item.count==null?'--':item.count+'篇'}}</span>
ad2b70 17                 </div>
L 18             </div>
19             <div class="blog-log-list">
20                 <div class="blog-log-item" v-for="item in list2">
4b854c 21                     <router-link :to="{path:'/articleList',query:{typeId:item.id}}">
63af45 22                         <span>{{item.typeName}}</span>
56a4b8 23                     </router-link>
63f511 24                     <span>{{item.count==null?'--':item.count+'篇'}}</span>
56a4b8 25
ad2b70 26                 </div>
L 27             </div>
28         </div>
29     </div>
30
31 </template>
32
33 <script>
63af45 34     import {
I 35         queryBlogArticleType
36     } from '../../api/blogArticleType.js'
ad2b70 37     export default {
63af45 38         beforeMount() {
2795be 39             //this.$message.info('loading', 0.3);
63af45 40             queryBlogArticleType({}).then((res) => {
4b854c 41                 this.list1 = res.data.slice(0, 3)
81c155 42                 if (res.data.length >= 3)
I 43                     this.list2 = res.data.slice(3)
63af45 44             })
I 45         },
ad2b70 46         data() {
L 47             return {
4b854c 48                 list1: [],
I 49                 list2: [],
ad2b70 50             }
L 51         }
52     }
53 </script>
54
55 </script>
56
57 <style lang="less">
4b854c 58     .blog-pigeonhole {
I 59         a {
60             color: black;
61         }
62     }
63
ad2b70 64     /*日志部分*/
L 65     .blog-log-list {
66         line-height: 1.6;
fa1bd9 67         // padding-left: 3%;
ad2b70 68         padding-right: 3%;
L 69
70         flex-wrap: wrap;
71         /*让弹性盒元素在必要的时候拆行:*/
72         display: -webkit-flex;
73         display: flex;
74         -webkit-justify-content: center;
75         justify-content: center;
76     }
77
78     .blog-log-item {
79         border-left: 2px solid rgba(222, 229, 231, .45);
80         width: 23%;
81         margin-bottom: 10px;
82
83         :first-child {
84             border-left: none;
85         }
86
d629d9 87         a {
L 88             color: black;
89         }
90
56a4b8 91         .link span:first-child {
ad2b70 92             color: #999;
L 93         }
94
56a4b8 95         .link span:last-child {
ad2b70 96             font-weight: 600;
L 97             font-size: 15px;
98         }
99
100         span {
101             display: block;
57e3be 102             font-size:15px;
ad2b70 103         }
L 104     }
105 </style>
731926 106 <style lang="less" scoped>
I 107     a:hover::after {
108         left: -50%;
109     }
110 </style>