Skip to content

Commit 3a36b01

Browse files
author
reco_luan
committed
fix: optimize access-number display
1 parent df0f498 commit 3a36b01

File tree

6 files changed

+19
-22
lines changed

6 files changed

+19
-22
lines changed

components/Home.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
<span v-if="$themeConfig.author || $site.title">{{ $themeConfig.author || $site.title }}</span>
5252
</a>
5353
</span>
54-
<span>
54+
<span v-show="$themeConfig.commentsSolution === 'valine'">
55+
<i class="iconfont reco-eye"></i>
5556
<AccessNumber idVal="/" />
5657
</span>
5758
</div>

components/HomeBlog.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<!-- 博客列表 -->
1313
<note-abstract
1414
:data="posts"
15-
:isHome="true"
15+
:hideAccessNumber="true"
1616
:currentPage="currentPage"></note-abstract>
1717
<!-- 分页 -->
1818
<pagation
@@ -70,7 +70,8 @@
7070
<span v-if="$themeConfig.author || $site.title">{{ $themeConfig.author || $site.title }}</span>
7171
</a>
7272
</span>
73-
<span>
73+
<span v-show="$themeConfig.commentsSolution === 'valine'">
74+
<i class="iconfont reco-eye"></i>
7475
<AccessNumber idVal="/" />
7576
</span>
7677
</div>
@@ -147,6 +148,7 @@ export default {
147148
}
148149
},
149150
mounted () {
151+
console.log(this)
150152
this.recoShow = true
151153
},
152154
methods: {

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" :isHome="!(isHome !== true)" :currentTag="currentTag"></PageInfo>
14+
<PageInfo :pageInfo="item" :hideAccessNumber="!(hideAccessNumber !== 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', 'isHome']
24+
props: ['data', 'currentPage', 'currentTag', 'hideAccessNumber']
2525
}
2626
</script>
2727

components/PageInfo.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
class="iconfont reco-date">
1111
<span>{{ pageInfo.frontmatter.date | formatDate }}</span>
1212
</i>
13-
<AccessNumber
14-
v-if="isHome !== true"
15-
:idVal="pageInfo.path"
16-
:numStyle="numStyle" />
13+
<i
14+
v-if="$themeConfig.commentsSolution === 'valine' && hideAccessNumber !== true"
15+
class="iconfont reco-eye">
16+
<AccessNumber
17+
:idVal="pageInfo.path"
18+
:numStyle="numStyle" />
19+
</i>
1720
<i
1821
v-if="pageInfo.frontmatter.tags"
1922
class="iconfont reco-tag tags">
@@ -46,7 +49,7 @@ export default {
4649
type: String,
4750
default: ''
4851
},
49-
isHome: {
52+
hideAccessNumber: {
5053
type: Boolean,
5154
default: false
5255
}

index.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,7 @@ module.exports = (options, ctx) => ({
2323
'@vuepress-reco/pagation',
2424
'@vuepress-reco/screenfull',
2525
'@vuepress-reco/ga',
26-
['@vuepress-reco/comments', {
27-
solution: 'valine',
28-
options: {
29-
appId: 'Q6hMeY2PSaM9FMkXetzoJoU5-gzGzoHsz',
30-
appKey: 'iLQlev5jo2Cm5pLcI0z3qhtr',
31-
placeholder: '填写邮箱可以收到回复提醒哦!',
32-
notify: true,
33-
recordIP: true
34-
}
35-
}],
26+
'@vuepress-reco/comments',
3627
'@vuepress/active-header-links',
3728
['@vuepress/plugin-blog', {
3829
permalink: '/:regular',

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuepress-theme-reco",
3-
"version": "1.0.9-alpha.12",
3+
"version": "1.0.9-alpha.13",
44
"description": "this is a vuepress theme",
55
"main": "index.js",
66
"scripts": {
@@ -31,7 +31,7 @@
3131
"@vuepress-reco/vuepress-plugin-pagation": "^1.0.3",
3232
"@vuepress-reco/vuepress-plugin-screenfull": "^1.0.0",
3333
"@vuepress-reco/vuepress-plugin-ga": "^1.0.2",
34-
"@vuepress-reco/vuepress-plugin-comments": "1.0.0-alpha.1",
34+
"@vuepress-reco/vuepress-plugin-comments": "1.0.1",
3535
"@vuepress/plugin-blog": "1.3.0",
3636
"leancloud-storage": "3.13.2",
3737
"valine": "1.3.6",

0 commit comments

Comments
 (0)