<template>
|
<div class="blog-container ">
|
<span class="blog-pigeonhole">
|
<!-- <router-link :to="{path:'/articleList'}">
|
分类
|
</router-link> -->
|
分类
|
</span>
|
<div class="blog-scroll ">
|
<div class="blog-log-list">
|
<div class="blog-log-item" v-for="(item,index) in list1">
|
<router-link :to="{path:'/articleList',query:{typeId:item.id}}">
|
<span>{{item.typeName}}</span>
|
</router-link>
|
|
<span>{{item.count==null?'--':item.count+'篇'}}</span>
|
</div>
|
</div>
|
<div class="blog-log-list">
|
<div class="blog-log-item" v-for="item in list2">
|
<router-link :to="{path:'/articleList',query:{typeId:item.id}}">
|
<span>{{item.typeName}}</span>
|
</router-link>
|
<span>{{item.count==null?'--':item.count+'篇'}}</span>
|
|
</div>
|
</div>
|
</div>
|
</div>
|
|
</template>
|
|
<script>
|
import {
|
queryBlogArticleType
|
} from '../../api/blogArticleType.js'
|
export default {
|
beforeMount() {
|
//this.$message.info('loading', 0.3);
|
queryBlogArticleType({}).then((res) => {
|
this.list1 = res.data.slice(0, 3)
|
if (res.data.length >= 3)
|
this.list2 = res.data.slice(3)
|
})
|
},
|
data() {
|
return {
|
list1: [],
|
list2: [],
|
}
|
}
|
}
|
</script>
|
|
</script>
|
|
<style lang="less">
|
.blog-pigeonhole {
|
a {
|
color: black;
|
}
|
}
|
|
/*日志部分*/
|
.blog-log-list {
|
line-height: 1.6;
|
// padding-left: 3%;
|
padding-right: 3%;
|
|
flex-wrap: wrap;
|
/*让弹性盒元素在必要的时候拆行:*/
|
display: -webkit-flex;
|
display: flex;
|
-webkit-justify-content: center;
|
justify-content: center;
|
}
|
|
.blog-log-item {
|
border-left: 2px solid rgba(222, 229, 231, .45);
|
width: 23%;
|
margin-bottom: 10px;
|
|
:first-child {
|
border-left: none;
|
}
|
|
a {
|
color: black;
|
}
|
|
.link span:first-child {
|
color: #999;
|
}
|
|
.link span:last-child {
|
font-weight: 600;
|
font-size: 15px;
|
}
|
|
span {
|
display: block;
|
font-size:15px;
|
}
|
}
|
</style>
|
<style lang="less" scoped>
|
a:hover::after {
|
left: -50%;
|
}
|
</style>
|