From 83426b5c96a88c3a6aa399eb6100ea5fb494fd0e Mon Sep 17 00:00:00 2001
From: xachary <179740385@qq.com>
Date: Thu, 9 Nov 2023 16:02:57 +0800
Subject: [PATCH] feat(layout): move setting button to tabs when fold (#3264)
---
src/layouts/default/feature/index.vue | 11 ++++++-
.../default/tabs/components/SettingButton.vue | 30 +++++++++++++++++++
src/layouts/default/tabs/index.vue | 12 ++++++++
3 files changed, 52 insertions(+), 1 deletion(-)
create mode 100644 src/layouts/default/tabs/components/SettingButton.vue
diff --git a/src/layouts/default/feature/index.vue b/src/layouts/default/feature/index.vue
index 3595848e8..cade61f92 100644
--- a/src/layouts/default/feature/index.vue
+++ b/src/layouts/default/feature/index.vue
@@ -12,6 +12,8 @@
import SessionTimeoutLogin from '/@/views/sys/login/SessionTimeoutLogin.vue';
+ import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting';
+
export default defineComponent({
name: 'LayoutFeatures',
components: {
@@ -41,12 +43,16 @@
return settingButtonPosition === SettingButtonPositionEnum.FIXED;
});
+ const { getShowMultipleTab } = useMultipleTabSetting();
+
return {
getTarget: () => document.body,
getUseOpenBackTop,
getIsFixedSettingDrawer,
prefixCls,
getIsSessionTimeout,
+ getShowMultipleTab,
+ getFullContent,
};
},
});
@@ -55,7 +61,10 @@
-
+
diff --git a/src/layouts/default/tabs/components/SettingButton.vue b/src/layouts/default/tabs/components/SettingButton.vue
new file mode 100644
index 000000000..6253fba6e
--- /dev/null
+++ b/src/layouts/default/tabs/components/SettingButton.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
diff --git a/src/layouts/default/tabs/index.vue b/src/layouts/default/tabs/index.vue
index 4d3df4281..a354b1211 100644
--- a/src/layouts/default/tabs/index.vue
+++ b/src/layouts/default/tabs/index.vue
@@ -19,6 +19,7 @@
+
@@ -53,6 +54,10 @@
import { useMouse } from '@vueuse/core';
import { multipleTabHeight } from '/@/settings/designSetting';
+ import SettingButton from './components/SettingButton.vue';
+ import { useHeaderSetting } from '/@/hooks/setting/useHeaderSetting';
+ import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
+
export default defineComponent({
name: 'MultipleTabs',
components: {
@@ -61,6 +66,7 @@
Tabs,
TabPane: Tabs.TabPane,
TabContent,
+ SettingButton,
},
setup() {
const affixTextList = initAffixTabs();
@@ -83,6 +89,10 @@
const { y: mouseY } = useMouse();
+ const { getShowMenu } = useMenuSetting();
+ const { getShowHeader } = useHeaderSetting();
+ const getIsUnFold = computed(() => !unref(getShowMenu) && !unref(getShowHeader));
+
const getWrapClass = computed(() => {
return [
prefixCls,
@@ -141,6 +151,8 @@
getShowQuick,
getShowRedo,
getShowFold,
+ getIsUnFold,
+ getShowHeader,
};
},
});