Unverified Commit 5340f483 by Sendya

fix: page-view meta info #132

parent a7f04177
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<div class="page-header-index-wide"> <div class="page-header-index-wide">
<slot> <slot>
<!-- keep-alive --> <!-- keep-alive -->
<route-view ref="content"></route-view> <router-view ref="content"></router-view>
</slot> </slot>
</div> </div>
</div> </div>
...@@ -50,12 +50,10 @@ ...@@ -50,12 +50,10 @@
<script> <script>
import PageHeader from '@/components/PageHeader' import PageHeader from '@/components/PageHeader'
import RouteView from './RouteView'
export default { export default {
name: 'PageView', name: 'PageView',
components: { components: {
RouteView,
PageHeader PageHeader
}, },
props: { props: {
...@@ -88,21 +86,13 @@ export default { ...@@ -88,21 +86,13 @@ export default {
updated () { updated () {
this.getPageHeaderInfo() this.getPageHeaderInfo()
}, },
computed: {
getPageTitle () {
return this.$route.meta.title
}
},
methods: { methods: {
getPageHeaderInfo () { getPageHeaderInfo () {
// 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 对象下的子节点的第一个对象 // 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
const content = this.$refs.content && this.$refs.content.$children[0] const content = this.$refs.content
if (content) { if (content) {
this.description = content.description this.description = content.description
this.linkList = content.linkList 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