Commit 4d16de0c by yanju

改变博客展示页有子栏目的展示

parent 8aace561
<template>
<i :class="'iconfont yun-icon--' + name" :style="{fontSize:size,color:color,transition:'.5s ease',cursor:cursor,verticalAlign:vertical,paddingBottom:pb}" @mouseenter="changeStyle1" @mouseout="changeStyle2"></i>
<i :class="'iconfont yun-icon--' + name" :style="{fontSize:size,color:color,transition:'.5s ease',cursor:cursor,verticalAlign:vertical,paddingBottom:pb}" ></i>
</template>
<script>
......@@ -12,7 +12,6 @@
color: String,
pb:String,
vertical:String,
hoverColor:String,
canClick:{
type:Boolean,
default:true,
......@@ -29,20 +28,7 @@
methods:{
changeStyle1(){
if(this.hoverColor){
this.prevColor=this.nowColor;
this.nowColor=this.hoverColor;
}
},
changeStyle2(){
if(this.hoverColor){
this.hoverColor=this.nowColor;
this.nowColor=this.prevColor;
}
}
}
};
</script>
......
......@@ -163,11 +163,12 @@
display: inline-block;
width: 103*$length;
margin-left: 5*$length;
margin-bottom: 10*$length;
@extend %nowrap;
@include fontStyle(14,20,500,#666,left);
@extend %animate-transition;
&:hover{
color: #00AAE6;
color: #00AAE6!important;
}
}
}
......
......@@ -53,6 +53,7 @@
<select-content
v-for="(item, index) in classList"
:item="item"
:itemIndex="index"
:key="`${item}${index}`"
@scrollTop="handleScroll"
@select="handleChange2"
......@@ -175,9 +176,9 @@ export default {
this.isShow2 = false;
this.$emit('handleClass', this.value);
},
handleScroll(num){
handleScroll(num,index){
setTimeout(()=>{
this.$refs.tagsBox.scrollTop = this.$refs.tagsBox.scrollTop+40*(num>4?5:num)
this.$refs.tagsBox.scrollTop = this.$refs.tagsBox.scrollTop+40*index
})
},
......
......@@ -16,6 +16,7 @@
export default {
name: "selectContent",
props: {
itemIndex:Number,
item: Object,
index: Number,
isHot: {
......@@ -34,8 +35,13 @@ export default {
methods: {
handleClick(){
if(this.item.childList){
if(this.showChildList){
this.showChildList = !this.showChildList;
this.$emit('scrollTop',this.item.childList.length,this.itemIndex)
}else{
this.showChildList = !this.showChildList;
this.$emit('scrollTop',this.item.childList.length)
}
}else {
this.$emit('select', this.item.tag, this.item.tagId);
......
......@@ -110,8 +110,8 @@ export default {
this.pages = this.articlePages;
},
dataGetBlogCategory(){
this.typeList.map(async (val,index)=> {
async dataGetBlogCategory(){
for(const val of this.typeList){
if(!val.leaf){
let childListData = await this.$axios.$get(config.api.get.BlogCategory.childList+val.categoryId+'/categories')
let childList =[];
......@@ -129,17 +129,18 @@ export default {
childList
})
}else{
this.list.push({
await this.list.push({
label: val.category,
address: '/blog',
type: val.categoryId.toString(),
})
}
})
}
},
getLabelTitle(){
let type = this.$route.query.type;
this.list.map((val,index)=>{
......
......@@ -230,7 +230,7 @@ export default {
data() {
return {
keepAliveTimer:null,
content:'',
markdownOption: {
bold: true, // 粗体
italic: true, // 斜体
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment