Commit 7dc95d67 by yanju

服务端渲染一级栏目

parent 4d16de0c
......@@ -74,6 +74,7 @@
},
watch:{
$route(to,from){
this.type = this.$route.query.type
......
......@@ -110,34 +110,38 @@ export default {
this.pages = this.articlePages;
},
async dataGetBlogCategory(){
for(const val of this.typeList){
dataGetBlogCategory(){
this.typeList.map((val) => {
if(!val.leaf){
let childListData = await this.$axios.$get(config.api.get.BlogCategory.childList+val.categoryId+'/categories')
let childList =[];
childListData.data.map((val,index)=>{
childList.push({
label: val.category,
address: '/blog',
childId: val.categoryId.toString(),
})
})
this.list.push({
label: val.category,
address: '/blog',
type: val.categoryId.toString(),
childList
childList:[]
})
}else{
await this.list.push({
this.list.push({
label: val.category,
address: '/blog',
type: val.categoryId.toString(),
})
}
})
this.typeList.map(async (val,index) => {
if(!val.leaf){
let childListData = await this.$axios.$get(config.api.get.BlogCategory.childList+val.categoryId+'/categories')
let childList =[];
childListData.data.map((val,index)=>{
childList.push({
label: val.category,
address: '/blog',
childId: val.categoryId.toString(),
})
})
this.list[index+1].childList = childList
}
})
},
getLabelTitle(){
......
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