Skip to content

Commit 2545a22

Browse files
committed
fix: page meta
1 parent bebb961 commit 2545a22

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/components/GlobalFooter/GlobalFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="footer">
33
<div class="links">
44
<a
5-
href="https://pro.ant.design/"
5+
href="https://pro.loacg.com/"
66
target="_blank"
77
>Pro 首页</a>
88
<a

src/layouts/PageView.vue

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,27 @@ export default {
8181
}
8282
},
8383
mounted () {
84-
this.getPageHeaderInfo()
84+
this.getPageMeta()
8585
},
8686
updated () {
87-
this.getPageHeaderInfo()
87+
this.getPageMeta()
8888
},
8989
methods: {
90-
getPageHeaderInfo () {
90+
getPageMeta () {
9191
// eslint-disable-next-line
9292
this.pageTitle = (typeof(this.title) === 'string' || !this.title) ? this.title : this.$route.meta.title
9393
94-
// 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
9594
const content = this.$refs.content
9695
if (content) {
97-
this.description = content.description
98-
this.linkList = content.linkList
99-
this.extraImage = content.extraImage
100-
this.search = content.search === true
101-
this.tabs = content.tabs
96+
if (content.pageMeta) {
97+
Object.assign(this, content.pageMeta)
98+
} else {
99+
this.description = content.description
100+
this.linkList = content.linkList
101+
this.extraImage = content.extraImage
102+
this.search = content.search === true
103+
this.tabs = content.tabs
104+
}
102105
}
103106
}
104107
}

0 commit comments

Comments
 (0)