Unverified Commit 5340f483 by Sendya

fix: page-view meta info #132

parent a7f04177
......@@ -41,7 +41,7 @@
<div class="page-header-index-wide">
<slot>
<!-- keep-alive -->
<route-view ref="content"></route-view>
<router-view ref="content"></router-view>
</slot>
</div>
</div>
......@@ -50,12 +50,10 @@
<script>
import PageHeader from '@/components/PageHeader'
import RouteView from './RouteView'
export default {
name: 'PageView',
components: {
RouteView,
PageHeader
},
props: {
......@@ -88,21 +86,13 @@ export default {
updated () {
this.getPageHeaderInfo()
},
computed: {
getPageTitle () {
return this.$route.meta.title
}
},
methods: {
getPageHeaderInfo () {
// 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 && this.$refs.content.$children[0]
const content = this.$refs.content
if (content) {
this.description = content.description
this.linkList = content.linkList
......
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