From 63af45eaa849552e4ea3ff0248c47bacb62cacdb Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Wed, 16 Feb 2022 18:28:19 +0800 Subject: [PATCH] 对接接口 --- src/components/mini/box2-class.vue | 137 ++++++++++++++++++++++++--------------------- 1 files changed, 74 insertions(+), 63 deletions(-) diff --git a/src/components/mini/box2-class.vue b/src/components/mini/box2-class.vue index 9b38315..2bb7ccf 100644 --- a/src/components/mini/box2-class.vue +++ b/src/components/mini/box2-class.vue @@ -5,18 +5,18 @@ <div class="blog-log-list"> <div class="blog-log-item" v-for="item in list1"> <router-link to='/main1'> - <span>{{item.name}}</span> + <span>{{item.typeName}}</span> </router-link> - <span>{{item.count}}</span> + <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="/box1"> - <span>{{item.name}}</span> + <span>{{item.typeName}}</span> </router-link> - <span>{{item.count}}</span> + <span>{{item.count==null?'--':item.count}}</span> </div> </div> @@ -26,68 +26,79 @@ </template> <script> + import { + queryBlogArticleType + } from '../../api/blogArticleType.js' export default { + beforeMount() { + queryBlogArticleType({}).then((res) => { + this.list1=res.data.slice(0,3) + this.list2=res.data.slice(4) + }) + }, data() { return { - list1: [{ - name: "日志", - count: 10 - }, { - name: "分类", - count: 12 - }, { - name: "标签", - count: 14 - }], - list2: [{ - name: "Tag", - count: 133 - }, { - name: "专题", - count: 10 - }, { - name: "偏好", - count: 12 - }, { - name: "星标", - count: 14 - },{ - name: "Tag", - count: 133 - }, { - name: "专题", - count: 10 - }, { - name: "偏好", - count: 12 - }, { - name: "星标", - count: 14 - },{ - name: "Tag", - count: 133 - }, { - name: "专题", - count: 10 - }, { - name: "偏好", - count: 12 - }, { - name: "星标", - count: 14 - },{ - name: "Tag", - count: 133 - }, { - name: "专题", - count: 10 - }, { - name: "偏好", - count: 12 - }, { - name: "星标", - count: 14 - }] + list1:[], + list2:[], + // list1: [{ + // name: "日志", + // count: 10 + // }, { + // name: "分类", + // count: 12 + // }, { + // name: "标签", + // count: 14 + // }], + // list2: [{ + // name: "Tag", + // count: 133 + // }, { + // name: "专题", + // count: 10 + // }, { + // name: "偏好", + // count: 12 + // }, { + // name: "星标", + // count: 14 + // },{ + // name: "Tag", + // count: 133 + // }, { + // name: "专题", + // count: 10 + // }, { + // name: "偏好", + // count: 12 + // }, { + // name: "星标", + // count: 14 + // },{ + // name: "Tag", + // count: 133 + // }, { + // name: "专题", + // count: 10 + // }, { + // name: "偏好", + // count: 12 + // }, { + // name: "星标", + // count: 14 + // },{ + // name: "Tag", + // count: 133 + // }, { + // name: "专题", + // count: 10 + // }, { + // name: "偏好", + // count: 12 + // }, { + // name: "星标", + // count: 14 + // }] } } } -- Gitblit v1.9.1