研发图纸文件管理系统-前端项目
chenghongxing
2020-08-25 9f034092a9c1ad104ba5ce73e97db7f4a55ef729
feat: add configuration of hiding page title in PageLayout; :star: #106
新增:增加隐藏 PageLayout 布局中页面标题的配置;
3个文件已修改
16 ■■■■ 已修改文件
src/components/page/header/PageHeader.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/config/default/setting.config.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layouts/PageLayout.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/header/PageHeader.vue
@@ -11,7 +11,7 @@
      <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">
@@ -28,11 +28,12 @@
</template>
<script>
import {mapState} from 'vuex'
export default {
  name: 'PageHeader',
  props: {
    title: {
      type: String,
      type: [String, Boolean],
      required: false
    },
    breadcrumb: {
@@ -49,9 +50,7 @@
    },
  },
  computed: {
    layout () {
      return this.$store.state.setting.layout
    }
    ...mapState('setting', ['layout', 'showPageTitle'])
  }
}
</script>
src/config/default/setting.config.js
@@ -15,8 +15,9 @@
  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
src/layouts/PageLayout.vue
@@ -63,7 +63,7 @@
    ...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