Unverified Commit 2545a22b by Sendya

fix: page meta

parent bebb961e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="footer"> <div class="footer">
<div class="links"> <div class="links">
<a <a
href="https://pro.ant.design/" href="https://pro.loacg.com/"
target="_blank" target="_blank"
>Pro 首页</a> >Pro 首页</a>
<a <a
......
...@@ -81,19 +81,21 @@ export default { ...@@ -81,19 +81,21 @@ export default {
} }
}, },
mounted () { mounted () {
this.getPageHeaderInfo() this.getPageMeta()
}, },
updated () { updated () {
this.getPageHeaderInfo() this.getPageMeta()
}, },
methods: { methods: {
getPageHeaderInfo () { getPageMeta () {
// eslint-disable-next-line // eslint-disable-next-line
this.pageTitle = (typeof(this.title) === 'string' || !this.title) ? this.title : this.$route.meta.title this.pageTitle = (typeof(this.title) === 'string' || !this.title) ? this.title : this.$route.meta.title
// 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
const content = this.$refs.content const content = this.$refs.content
if (content) { if (content) {
if (content.pageMeta) {
Object.assign(this, content.pageMeta)
} else {
this.description = content.description this.description = content.description
this.linkList = content.linkList this.linkList = content.linkList
this.extraImage = content.extraImage this.extraImage = content.extraImage
...@@ -102,6 +104,7 @@ export default { ...@@ -102,6 +104,7 @@ export default {
} }
} }
} }
}
} }
</script> </script>
......
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