Commit 4d16de0c by yanju

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

parent 8aace561
<template> <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> </template>
<script> <script>
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
color: String, color: String,
pb:String, pb:String,
vertical:String, vertical:String,
hoverColor:String,
canClick:{ canClick:{
type:Boolean, type:Boolean,
default:true, default:true,
...@@ -29,20 +28,7 @@ ...@@ -29,20 +28,7 @@
methods:{ 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> </script>
......
...@@ -163,11 +163,12 @@ ...@@ -163,11 +163,12 @@
display: inline-block; display: inline-block;
width: 103*$length; width: 103*$length;
margin-left: 5*$length; margin-left: 5*$length;
margin-bottom: 10*$length;
@extend %nowrap; @extend %nowrap;
@include fontStyle(14,20,500,#666,left); @include fontStyle(14,20,500,#666,left);
@extend %animate-transition; @extend %animate-transition;
&:hover{ &:hover{
color: #00AAE6; color: #00AAE6!important;
} }
} }
} }
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<select-content <select-content
v-for="(item, index) in classList" v-for="(item, index) in classList"
:item="item" :item="item"
:itemIndex="index"
:key="`${item}${index}`" :key="`${item}${index}`"
@scrollTop="handleScroll" @scrollTop="handleScroll"
@select="handleChange2" @select="handleChange2"
...@@ -175,9 +176,9 @@ export default { ...@@ -175,9 +176,9 @@ export default {
this.isShow2 = false; this.isShow2 = false;
this.$emit('handleClass', this.value); this.$emit('handleClass', this.value);
}, },
handleScroll(num){ handleScroll(num,index){
setTimeout(()=>{ 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 @@ ...@@ -16,6 +16,7 @@
export default { export default {
name: "selectContent", name: "selectContent",
props: { props: {
itemIndex:Number,
item: Object, item: Object,
index: Number, index: Number,
isHot: { isHot: {
...@@ -34,8 +35,13 @@ export default { ...@@ -34,8 +35,13 @@ export default {
methods: { methods: {
handleClick(){ handleClick(){
if(this.item.childList){ 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.showChildList = !this.showChildList;
this.$emit('scrollTop',this.item.childList.length) }
}else { }else {
this.$emit('select', this.item.tag, this.item.tagId); this.$emit('select', this.item.tag, this.item.tagId);
......
...@@ -110,8 +110,8 @@ export default { ...@@ -110,8 +110,8 @@ export default {
this.pages = this.articlePages; this.pages = this.articlePages;
}, },
dataGetBlogCategory(){ async dataGetBlogCategory(){
this.typeList.map(async (val,index)=> { for(const val of this.typeList){
if(!val.leaf){ if(!val.leaf){
let childListData = await this.$axios.$get(config.api.get.BlogCategory.childList+val.categoryId+'/categories') let childListData = await this.$axios.$get(config.api.get.BlogCategory.childList+val.categoryId+'/categories')
let childList =[]; let childList =[];
...@@ -129,17 +129,18 @@ export default { ...@@ -129,17 +129,18 @@ export default {
childList childList
}) })
}else{ }else{
this.list.push({ await this.list.push({
label: val.category, label: val.category,
address: '/blog', address: '/blog',
type: val.categoryId.toString(), type: val.categoryId.toString(),
}) })
} }
}) }
}, },
getLabelTitle(){ getLabelTitle(){
let type = this.$route.query.type; let type = this.$route.query.type;
this.list.map((val,index)=>{ this.list.map((val,index)=>{
......
...@@ -230,7 +230,7 @@ export default { ...@@ -230,7 +230,7 @@ export default {
data() { data() {
return { return {
keepAliveTimer:null, keepAliveTimer:null,
content:'',
markdownOption: { markdownOption: {
bold: true, // 粗体 bold: true, // 粗体
italic: 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