Skip to content

Commit

Permalink
fix: page-view meta info #132
Browse files Browse the repository at this point in the history
  • Loading branch information
sendya committed Mar 22, 2019
1 parent a7f0417 commit 5340f48
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/layouts/PageView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -50,12 +50,10 @@

<script>
import PageHeader from '@/components/PageHeader'
import RouteView from './RouteView'
export default {
name: 'PageView',
components: {
RouteView,
PageHeader
},
props: {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5340f48

Please sign in to comment.