mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-06 04:00:06 +08:00
feat: add configuration of hidden settings drawer; 🌟
新增:隐藏设置抽屉的配置;
This commit is contained in:
parent
1f02623837
commit
195624a0a1
@ -49,6 +49,10 @@
|
||||
{{$t('other.multiPages')}}
|
||||
<a-switch :checked="multiPage" slot="actions" size="small" @change="setMultiPage" />
|
||||
</a-list-item>
|
||||
<a-list-item>
|
||||
{{$t('other.hideSetting')}}
|
||||
<a-switch :checked="hideSetting" slot="actions" size="small" @change="setHideSetting" />
|
||||
</a-list-item>
|
||||
</a-list>
|
||||
</setting-item>
|
||||
<a-divider />
|
||||
@ -107,7 +111,7 @@ export default {
|
||||
themeColorIndex() {
|
||||
return [this.colors.indexOf(this.themeColor)]
|
||||
},
|
||||
...mapState('setting', ['theme', 'themeColor', 'layout', 'animates', 'multiPage', 'weekMode', 'fixedHeader', 'fixedSideBar'])
|
||||
...mapState('setting', ['theme', 'themeColor', 'layout', 'animates', 'multiPage', 'weekMode', 'fixedHeader', 'fixedSideBar', 'hideSetting'])
|
||||
},
|
||||
methods: {
|
||||
onColorChange (values, colors) {
|
||||
@ -129,7 +133,8 @@ export default {
|
||||
}
|
||||
this.setAnimate({name: this.animate, direction: this.direction})
|
||||
},
|
||||
...mapMutations('setting', ['setTheme', 'setThemeColor', 'setLayout', 'setMultiPage', 'setWeekMode', 'setFixedSideBar', 'setFixedHeader', 'setAnimate'])
|
||||
...mapMutations('setting', ['setTheme', 'setThemeColor', 'setLayout', 'setMultiPage', 'setWeekMode',
|
||||
'setFixedSideBar', 'setFixedHeader', 'setAnimate', 'setHideSetting'])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -23,7 +23,8 @@ module.exports = {
|
||||
other: {
|
||||
title: '其他设置',
|
||||
weekMode: '色弱模式',
|
||||
multiPages: '多页签模式'
|
||||
multiPages: '多页签模式',
|
||||
hideSetting: '隐藏设置抽屉'
|
||||
},
|
||||
animate: {
|
||||
title: '页面切换动画',
|
||||
@ -55,7 +56,8 @@ module.exports = {
|
||||
other: {
|
||||
title: '其他設置',
|
||||
weekMode: '色弱模式',
|
||||
multiPages: '多頁簽模式'
|
||||
multiPages: '多頁簽模式',
|
||||
hideSetting: '隱藏設置抽屜'
|
||||
},
|
||||
animate: {
|
||||
title: '頁面切換動畫',
|
||||
@ -87,7 +89,8 @@ module.exports = {
|
||||
other: {
|
||||
title: 'Other Setting',
|
||||
weekMode: 'Week Mode',
|
||||
multiPages: 'Multi Pages'
|
||||
multiPages: 'Multi Pages',
|
||||
hideSetting: 'Hide Setting Drawer'
|
||||
},
|
||||
animate: {
|
||||
title: 'Page Toggle Animation',
|
||||
|
@ -8,6 +8,7 @@ module.exports = {
|
||||
fixedSideBar: true, //固定侧边栏,true:固定,false:不固定
|
||||
weekMode: false, //色弱模式,true:开启,false:不开启
|
||||
multiPage: false, //多页签模式,true:开启,false:不开启
|
||||
hideSetting: false, //隐藏设置抽屉,true:隐藏,false:不隐藏
|
||||
systemName: 'Vue Antd Admin', //系统名称
|
||||
copyright: '2018 ICZER 工作室出品', //copyright
|
||||
animate: { //动画设置
|
||||
|
@ -4,7 +4,7 @@
|
||||
<side-menu :theme="theme" :menuData="menuData" :collapsed="false" :collapsible="false" @menuSelect="onMenuSelect"/>
|
||||
</drawer>
|
||||
<side-menu :theme="theme" v-else-if="layout === 'side'" :menuData="menuData" :collapsed="collapsed" :collapsible="true" />
|
||||
<drawer :open-drawer="showSetting" placement="right" @change="onSettingDrawerChange">
|
||||
<drawer v-if="!hideSetting" :open-drawer="showSetting" placement="right" @change="onSettingDrawerChange">
|
||||
<div class="setting" slot="handler">
|
||||
<a-icon :type="showSetting ? 'close' : 'setting'"/>
|
||||
</div>
|
||||
@ -55,7 +55,7 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState('setting', ['isMobile', 'theme', 'layout', 'footerLinks', 'copyright', 'fixedHeader', 'fixedSideBar']),
|
||||
...mapState('setting', ['isMobile', 'theme', 'layout', 'footerLinks', 'copyright', 'fixedHeader', 'fixedSideBar', 'hideSetting']),
|
||||
sideMenuWidth() {
|
||||
return this.collapsed ? '80px' : '256px'
|
||||
},
|
||||
|
@ -40,6 +40,9 @@ export default {
|
||||
},
|
||||
setRoutesI18n(state, i18n) {
|
||||
state.routesI18n = i18n
|
||||
},
|
||||
setHideSetting(state, hideSetting) {
|
||||
state.hideSetting = hideSetting
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user