新增布局PageLayout,优化代码结构

This commit is contained in:
chenghx
2018-07-25 15:23:52 +08:00
parent 45a2c86b37
commit 5014a92bd2
4 changed files with 6 additions and 36 deletions

View File

@@ -1,42 +0,0 @@
<template>
<div style="margin: -24px -24px 0px">
<page-header :breadcrumb="breadcrumb" :title="title">
<div slot="content">{{desc}}</div>
</page-header>
<div style="margin: 24px 24px 0px">
<router-view ref="page"/>
</div>
</div>
</template>
<script>
import PageHeader from '../page/PageHeader'
export default {
name: 'Form',
components: {PageHeader},
data () {
return {
title: '',
breadcrumb: [],
desc: ''
}
},
mounted () {
this.getPageHeaderInfo()
},
beforeUpdate () {
this.getPageHeaderInfo()
},
methods: {
getPageHeaderInfo () {
this.title = this.$route.name
this.breadcrumb = this.$route.matched
this.desc = this.$refs.page.desc
}
}
}
</script>
<style scoped>
</style>