Skip to content

Commit 342db2b

Browse files
committed
fix: category btn style & home-blog router jump
1 parent 23c3786 commit 342db2b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

components/HomeBlog.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
<h4><i class="iconfont reco-category"></i> 分类</h4>
3232
<ul class="category-wrapper">
3333
<li class="category-item" v-for="(item, index) in this.$categories.list" :key="index">
34-
<a :href="item.path">
34+
<router-link :to="item.path">
3535
<span class="category-name">{{ item.name }}</span>
3636
<span class="post-num">{{ item.posts.length }}</span>
37-
</a>
37+
</router-link>
3838
</li>
3939
</ul>
4040
<hr>
@@ -168,7 +168,8 @@ export default {
168168
this.pages = pages.length == 0 ? [] : pages
169169
},
170170
getPagesByTags (currentTag) {
171-
window.location.href = `/tag/#?tag=${currentTag}`
171+
const base = this.$site.base
172+
window.location.href = `${base}tag/#?tag=${currentTag}`
172173
},
173174
// 获取时间的数字类型
174175
_getTimeNum (data) {

layouts/Category.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,17 @@ export default {
112112
background $accentColor
113113
a span.category-name {
114114
color #fff
115+
.post-num {
116+
color $accentColor
117+
}
115118
}
116119
}
117120
118121
a {
119122
display flex
120123
justify-content: space-between
121124
align-items center
125+
color: #666
122126
.post-num {
123127
margin-left 4px
124128
width 1.2rem;
@@ -128,7 +132,6 @@ export default {
128132
border-radius 50%
129133
background #eee
130134
font-size .4rem
131-
color $textColor
132135
}
133136
}
134137
}

0 commit comments

Comments
 (0)