2019-04-15 10:35:40 +08:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<i
|
|
|
|
class="iconfont reco-account"
|
2019-05-08 15:13:18 +08:00
|
|
|
v-if="pageInfo.frontmatter.author || $themeConfig.author || $site.title">
|
|
|
|
<span>{{ pageInfo.frontmatter.author || $themeConfig.author || $site.title }}</span>
|
2019-04-15 10:35:40 +08:00
|
|
|
</i>
|
|
|
|
<i class="iconfont reco-date" v-if="pageInfo.frontmatter.date"><span>{{ new Date(pageInfo.frontmatter.date).toLocaleDateString() }}</span></i>
|
2019-07-20 19:38:25 +08:00
|
|
|
<AccessNumber v-if="isHome !== true" :idVal="pageInfo.path" :numStyle="numStyle"></AccessNumber>
|
2019-04-15 10:35:40 +08:00
|
|
|
<i class="iconfont reco-tag tags" v-if="pageInfo.frontmatter.tags">
|
|
|
|
<span
|
|
|
|
v-for="(subItem, subIndex) in pageInfo.frontmatter.tags"
|
|
|
|
:key="subIndex"
|
|
|
|
class="tag-item"
|
|
|
|
:class="{ 'active': currentTag == subItem }"
|
|
|
|
@click="goTags(subItem)">
|
|
|
|
{{subItem}}
|
|
|
|
</span>
|
|
|
|
</i>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import AccessNumber from './Valine/AccessNumber'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: { AccessNumber },
|
2019-07-20 19:38:25 +08:00
|
|
|
// props: ['pageInfo', 'currentTag'],
|
|
|
|
props: {
|
|
|
|
pageInfo: {
|
|
|
|
type: Object,
|
|
|
|
default: {}
|
|
|
|
},
|
|
|
|
currentTag: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
|
|
|
},
|
|
|
|
isHome: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
}
|
|
|
|
},
|
2019-04-15 10:35:40 +08:00
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
numStyle: {
|
|
|
|
fontSize: '.9rem',
|
|
|
|
fontWeight: 'normal',
|
|
|
|
color: '#999'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
goTags (tag) {
|
2019-07-25 16:23:47 +08:00
|
|
|
const base = this.$site.base
|
2019-08-31 01:32:53 +08:00
|
|
|
window.location.href = `${base}tag/?tag=${tag}`
|
2019-04-15 10:35:40 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
|
|
|
|
.iconfont
|
|
|
|
display inline-block
|
|
|
|
line-height 1.5rem
|
|
|
|
&:not(:last-child)
|
|
|
|
margin-right 1rem
|
|
|
|
span
|
|
|
|
margin-left .5rem
|
|
|
|
.tags
|
|
|
|
.tag-item
|
|
|
|
cursor: pointer;
|
2019-08-04 00:32:06 +08:00
|
|
|
font-family Ubuntu, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif
|
2019-04-15 10:35:40 +08:00
|
|
|
&.active
|
|
|
|
color $accentColor
|
|
|
|
&:hover
|
|
|
|
color $accentColor
|
|
|
|
|
|
|
|
@media (max-width: $MQMobile)
|
|
|
|
.tags
|
|
|
|
display block
|
|
|
|
margin-left: 0!important;
|
|
|
|
</style>
|