Skip to content

Commit d476d6f

Browse files
committed
fix: hide read number of home articles
1 parent 944b0a0 commit d476d6f

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

components/HomeBlog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
v-if="showList"
1414
class="blog-list"
1515
:data="posts"
16+
:isHome="true"
1617
:currentPage="1"></note-abstract>
1718
<div class="info-wrapper">
1819
<img class="personal-img" :src="$frontmatter.faceImage || $themeConfig.logo" alt="hero">

components/NoteAbstract.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</div>
1212
<div class="abstract" v-html="item.excerpt"></div>
1313
<hr>
14-
<PageInfo :pageInfo="item" :currentTag="currentTag"></PageInfo>
14+
<PageInfo :pageInfo="item" :isHome="!(isHome !== true)" :currentTag="currentTag"></PageInfo>
1515
</div>
1616
</div>
1717
</template>
@@ -21,7 +21,7 @@ import PageInfo from './PageInfo'
2121
2222
export default {
2323
components: { PageInfo },
24-
props: ['data', 'currentPage', 'currentTag']
24+
props: ['data', 'currentPage', 'currentTag', 'isHome']
2525
}
2626
</script>
2727

components/PageInfo.vue

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<span>{{ pageInfo.frontmatter.author || $themeConfig.author || $site.title }}</span>
77
</i>
88
<i class="iconfont reco-date" v-if="pageInfo.frontmatter.date"><span>{{ new Date(pageInfo.frontmatter.date).toLocaleDateString() }}</span></i>
9-
<AccessNumber :idVal="pageInfo.path" :numStyle="numStyle"></AccessNumber>
9+
<AccessNumber v-if="isHome !== true" :idVal="pageInfo.path" :numStyle="numStyle"></AccessNumber>
1010
<i class="iconfont reco-tag tags" v-if="pageInfo.frontmatter.tags">
1111
<span
1212
v-for="(subItem, subIndex) in pageInfo.frontmatter.tags"
@@ -25,7 +25,21 @@ import AccessNumber from './Valine/AccessNumber'
2525
2626
export default {
2727
components: { AccessNumber },
28-
props: ['pageInfo', 'currentTag'],
28+
// props: ['pageInfo', 'currentTag'],
29+
props: {
30+
pageInfo: {
31+
type: Object,
32+
default: {}
33+
},
34+
currentTag: {
35+
type: String,
36+
default: ''
37+
},
38+
isHome: {
39+
type: Boolean,
40+
default: false
41+
}
42+
},
2943
data () {
3044
return {
3145
numStyle: {
@@ -35,10 +49,14 @@ export default {
3549
}
3650
}
3751
},
52+
53+
mounted () {
54+
console.log(1234, this.isHome)
55+
},
3856
3957
methods: {
4058
goTags (tag) {
41-
window.location.href = `/tag/?tag=${tag}`
59+
window.location.href = `/tag/#?tag=${tag}`
4260
}
4361
}
4462
}

components/SidebarLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default {
3030
: selfActive
3131
const link = renderLink(h, item.path, item.title || item.path, active)
3232
33-
const configDepth = $frontmatter.sidebarDepth
33+
const configDepth = $page.frontmatter.sidebarDepth
3434
|| sidebarDepth
3535
|| $themeLocaleConfig.sidebarDepth
3636
|| $themeConfig.sidebarDepth

0 commit comments

Comments
 (0)