fix: hide read number of home articles

This commit is contained in:
reco_luan 2019-07-20 19:38:25 +08:00
parent 944b0a0aad
commit d476d6fcd8
4 changed files with 25 additions and 6 deletions

View File

@ -13,6 +13,7 @@
v-if="showList"
class="blog-list"
:data="posts"
:isHome="true"
:currentPage="1"></note-abstract>
<div class="info-wrapper">
<img class="personal-img" :src="$frontmatter.faceImage || $themeConfig.logo" alt="hero">

View File

@ -11,7 +11,7 @@
</div>
<div class="abstract" v-html="item.excerpt"></div>
<hr>
<PageInfo :pageInfo="item" :currentTag="currentTag"></PageInfo>
<PageInfo :pageInfo="item" :isHome="!(isHome !== true)" :currentTag="currentTag"></PageInfo>
</div>
</div>
</template>
@ -21,7 +21,7 @@ import PageInfo from './PageInfo'
export default {
components: { PageInfo },
props: ['data', 'currentPage', 'currentTag']
props: ['data', 'currentPage', 'currentTag', 'isHome']
}
</script>

View File

@ -6,7 +6,7 @@
<span>{{ pageInfo.frontmatter.author || $themeConfig.author || $site.title }}</span>
</i>
<i class="iconfont reco-date" v-if="pageInfo.frontmatter.date"><span>{{ new Date(pageInfo.frontmatter.date).toLocaleDateString() }}</span></i>
<AccessNumber :idVal="pageInfo.path" :numStyle="numStyle"></AccessNumber>
<AccessNumber v-if="isHome !== true" :idVal="pageInfo.path" :numStyle="numStyle"></AccessNumber>
<i class="iconfont reco-tag tags" v-if="pageInfo.frontmatter.tags">
<span
v-for="(subItem, subIndex) in pageInfo.frontmatter.tags"
@ -25,7 +25,21 @@ import AccessNumber from './Valine/AccessNumber'
export default {
components: { AccessNumber },
props: ['pageInfo', 'currentTag'],
// props: ['pageInfo', 'currentTag'],
props: {
pageInfo: {
type: Object,
default: {}
},
currentTag: {
type: String,
default: ''
},
isHome: {
type: Boolean,
default: false
}
},
data () {
return {
numStyle: {
@ -35,10 +49,14 @@ export default {
}
}
},
mounted () {
console.log(1234, this.isHome)
},
methods: {
goTags (tag) {
window.location.href = `/tag/?tag=${tag}`
window.location.href = `/tag/#?tag=${tag}`
}
}
}

View File

@ -30,7 +30,7 @@ export default {
: selfActive
const link = renderLink(h, item.path, item.title || item.path, active)
const configDepth = $frontmatter.sidebarDepth
const configDepth = $page.frontmatter.sidebarDepth
|| sidebarDepth
|| $themeLocaleConfig.sidebarDepth
|| $themeConfig.sidebarDepth