Unverified Commit 2545a22b by Sendya

fix: page meta

parent bebb961e
......@@ -2,7 +2,7 @@
<div class="footer">
<div class="links">
<a
href="https://pro.ant.design/"
href="https://pro.loacg.com/"
target="_blank"
>Pro 首页</a>
<a
......
......@@ -81,24 +81,27 @@ export default {
}
},
mounted () {
this.getPageHeaderInfo()
this.getPageMeta()
},
updated () {
this.getPageHeaderInfo()
this.getPageMeta()
},
methods: {
getPageHeaderInfo () {
getPageMeta () {
// eslint-disable-next-line
this.pageTitle = (typeof(this.title) === 'string' || !this.title) ? this.title : this.$route.meta.title
// 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
const content = this.$refs.content
if (content) {
this.description = content.description
this.linkList = content.linkList
this.extraImage = content.extraImage
this.search = content.search === true
this.tabs = content.tabs
if (content.pageMeta) {
Object.assign(this, content.pageMeta)
} else {
this.description = content.description
this.linkList = content.linkList
this.extraImage = content.extraImage
this.search = content.search === true
this.tabs = content.tabs
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment