mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-05 19:41:37 +08:00
feat: add configuration of hiding page title in PageLayout; ⭐ #106
新增:增加隐藏 PageLayout 布局中页面标题的配置;
This commit is contained in:
parent
de925b254e
commit
9f034092a9
@ -11,7 +11,7 @@
|
|||||||
<div class="detail">
|
<div class="detail">
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="row">
|
<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 class="action"><slot name="action"></slot></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -28,11 +28,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {mapState} from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: 'PageHeader',
|
name: 'PageHeader',
|
||||||
props: {
|
props: {
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: [String, Boolean],
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
breadcrumb: {
|
breadcrumb: {
|
||||||
@ -49,9 +50,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
layout () {
|
...mapState('setting', ['layout', 'showPageTitle'])
|
||||||
return this.$store.state.setting.layout
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -15,8 +15,9 @@ module.exports = {
|
|||||||
multiPage: false, //多页签模式,true:开启,false:不开启
|
multiPage: false, //多页签模式,true:开启,false:不开启
|
||||||
hideSetting: false, //隐藏设置抽屉,true:隐藏,false:不隐藏
|
hideSetting: false, //隐藏设置抽屉,true:隐藏,false:不隐藏
|
||||||
systemName: 'Vue Antd Admin', //系统名称
|
systemName: 'Vue Antd Admin', //系统名称
|
||||||
copyright: '2018 ICZER 工作室出品', //copyright
|
copyright: '2018 ICZER 工作室出品', //copyright
|
||||||
asyncRoutes: false, //异步加载路由,true:开启,false:不开启
|
asyncRoutes: false, //异步加载路由,true:开启,false:不开启
|
||||||
|
showPageTitle: true, //是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
|
||||||
animate: { //动画设置
|
animate: { //动画设置
|
||||||
disabled: false, //禁用动画,true:禁用,false:启用
|
disabled: false, //禁用动画,true:禁用,false:启用
|
||||||
name: 'bounce', //动画效果,支持的动画效果可参考 ./animate.config.js
|
name: 'bounce', //动画效果,支持的动画效果可参考 ./animate.config.js
|
||||||
|
@ -63,7 +63,7 @@ export default {
|
|||||||
...mapState('setting', ['layout', 'multiPage', 'pageMinHeight']),
|
...mapState('setting', ['layout', 'multiPage', 'pageMinHeight']),
|
||||||
pageTitle() {
|
pageTitle() {
|
||||||
let pageTitle = this.page && this.page.title
|
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() {
|
routeName() {
|
||||||
const route = this.$route
|
const route = this.$route
|
||||||
|
Loading…
x
Reference in New Issue
Block a user