feat: add configuration of hiding page title in PageLayout; :star: #106
新增:增加隐藏 PageLayout 布局中页面标题的配置;
| | |
| | | <div class="detail"> |
| | | <div class="main"> |
| | | <div class="row"> |
| | | <h1 v-if="title" class="title">{{title}}</h1> |
| | | <h1 v-if="showPageTitle && title" class="title">{{title}}</h1> |
| | | <div class="action"><slot name="action"></slot></div> |
| | | </div> |
| | | <div class="row"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {mapState} from 'vuex' |
| | | export default { |
| | | name: 'PageHeader', |
| | | props: { |
| | | title: { |
| | | type: String, |
| | | type: [String, Boolean], |
| | | required: false |
| | | }, |
| | | breadcrumb: { |
| | |
| | | }, |
| | | }, |
| | | computed: { |
| | | layout () { |
| | | return this.$store.state.setting.layout |
| | | } |
| | | ...mapState('setting', ['layout', 'showPageTitle']) |
| | | } |
| | | } |
| | | </script> |
| | |
| | | multiPage: false, //多页签模式,true:开启,false:不开启 |
| | | hideSetting: false, //隐藏设置抽屉,true:隐藏,false:不隐藏 |
| | | systemName: 'Vue Antd Admin', //系统名称 |
| | | copyright: '2018 ICZER 工作室出品', //copyright |
| | | asyncRoutes: false, //异步加载路由,true:开启,false:不开启 |
| | | copyright: '2018 ICZER 工作室出品', //copyright |
| | | asyncRoutes: false, //异步加载路由,true:开启,false:不开启 |
| | | showPageTitle: true, //是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示 |
| | | animate: { //动画设置 |
| | | disabled: false, //禁用动画,true:禁用,false:启用 |
| | | name: 'bounce', //动画效果,支持的动画效果可参考 ./animate.config.js |
| | |
| | | ...mapState('setting', ['layout', 'multiPage', 'pageMinHeight']), |
| | | pageTitle() { |
| | | let pageTitle = this.page && this.page.title |
| | | return this.title || this.$t(pageTitle) || this.routeName |
| | | return pageTitle === undefined ? (this.title || this.routeName) : this.$t(pageTitle) |
| | | }, |
| | | routeName() { |
| | | const route = this.$route |