Skip to content

Commit 8dd5cdd

Browse files
committed
fix: fix article numbers in home page
1 parent cd1d289 commit 8dd5cdd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

components/HomeBlog.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<h3 class="name" v-if="$themeConfig.author || $site.title">{{ $themeConfig.author || $site.title }}</h3>
2020
<div class="num">
2121
<div>
22-
<h3>{{$site.pages.length}}</h3>
22+
<h3>{{getPagesLength}}</h3>
2323
<h6>文章</h6>
2424
</div>
2525
<div>
@@ -106,8 +106,12 @@ export default {
106106
},
107107
108108
// 分类信息
109-
categoryList () {
110-
console.log(this)
109+
getPagesLength () {
110+
let num = 0
111+
this.$categories.list.map(v => {
112+
num += v.posts.length
113+
})
114+
return num
111115
},
112116
year () {
113117
return new Date().getFullYear()

0 commit comments

Comments
 (0)