Commit 576150386b5bd7eec08a6628ab7aa37c8e100c00
1 parent
b335e751
chore: update layout
Showing
6 changed files
with
22 additions
and
37 deletions
CHANGELOG.zh_CN.md
src/components/Application/src/AppLocalePicker.vue
src/layouts/default/feature/index.vue
1 | <template> | 1 | <template> |
2 | <LayoutLockPage /> | 2 | <LayoutLockPage /> |
3 | <BackTop v-if="getUseOpenBackTop" :target="getTarget" /> | 3 | <BackTop v-if="getUseOpenBackTop" :target="getTarget" /> |
4 | - <SettingDrawer v-if="getShowSettingButton" /> | ||
5 | </template> | 4 | </template> |
6 | <script lang="ts"> | 5 | <script lang="ts"> |
7 | import { defineComponent } from 'vue'; | 6 | import { defineComponent } from 'vue'; |
@@ -14,15 +13,13 @@ | @@ -14,15 +13,13 @@ | ||
14 | components: { | 13 | components: { |
15 | BackTop, | 14 | BackTop, |
16 | LayoutLockPage: createAsyncComponent(() => import('/@/views/sys/lock/index.vue')), | 15 | LayoutLockPage: createAsyncComponent(() => import('/@/views/sys/lock/index.vue')), |
17 | - SettingDrawer: createAsyncComponent(() => import('/@/layouts/default/setting/index.vue')), | ||
18 | }, | 16 | }, |
19 | setup() { | 17 | setup() { |
20 | - const { getUseOpenBackTop, getShowSettingButton } = useRootSetting(); | 18 | + const { getUseOpenBackTop } = useRootSetting(); |
21 | 19 | ||
22 | return { | 20 | return { |
23 | getTarget: () => document.body, | 21 | getTarget: () => document.body, |
24 | getUseOpenBackTop, | 22 | getUseOpenBackTop, |
25 | - getShowSettingButton, | ||
26 | }; | 23 | }; |
27 | }, | 24 | }, |
28 | }); | 25 | }); |
src/layouts/default/header/index.less
1 | @header-trigger-prefix-cls: ~'@{namespace}-layout-header-trigger'; | 1 | @header-trigger-prefix-cls: ~'@{namespace}-layout-header-trigger'; |
2 | @header-prefix-cls: ~'@{namespace}-layout-header'; | 2 | @header-prefix-cls: ~'@{namespace}-layout-header'; |
3 | -@locale-prefix-cls: ~'@{namespace}-app-locale-picker'; | ||
4 | @breadcrumb-prefix-cls: ~'@{namespace}-layout-breadcrumb'; | 3 | @breadcrumb-prefix-cls: ~'@{namespace}-layout-breadcrumb'; |
5 | @logo-prefix-cls: ~'@{namespace}-app-logo'; | 4 | @logo-prefix-cls: ~'@{namespace}-app-logo'; |
6 | 5 | ||
@@ -104,7 +103,7 @@ | @@ -104,7 +103,7 @@ | ||
104 | &-action { | 103 | &-action { |
105 | display: flex; | 104 | display: flex; |
106 | min-width: 180px; | 105 | min-width: 180px; |
107 | - padding-right: 12px; | 106 | + // padding-right: 12px; |
108 | align-items: center; | 107 | align-items: center; |
109 | 108 | ||
110 | &__item { | 109 | &__item { |
@@ -146,13 +145,15 @@ | @@ -146,13 +145,15 @@ | ||
146 | 145 | ||
147 | .@{header-prefix-cls}-action { | 146 | .@{header-prefix-cls}-action { |
148 | &__item { | 147 | &__item { |
149 | - &:hover { | ||
150 | - background: @header-light-bg-hover-color; | 148 | + color: @text-color-base; |
149 | + | ||
150 | + .app-iconify { | ||
151 | + padding: 0 10px; | ||
152 | + font-size: 16px !important; | ||
151 | } | 153 | } |
152 | 154 | ||
153 | - .@{locale-prefix-cls} { | ||
154 | - padding: 0 6px; | ||
155 | - color: rgba(0, 0, 0, 0.65); | 155 | + &:hover { |
156 | + background: @header-light-bg-hover-color; | ||
156 | } | 157 | } |
157 | } | 158 | } |
158 | 159 |
src/layouts/default/header/index.vue
@@ -41,14 +41,16 @@ | @@ -41,14 +41,16 @@ | ||
41 | 41 | ||
42 | <FullScreen v-if="getShowFullScreen" :class="`${prefixCls}-action__item fullscreen-item`" /> | 42 | <FullScreen v-if="getShowFullScreen" :class="`${prefixCls}-action__item fullscreen-item`" /> |
43 | 43 | ||
44 | - <UserDropDown :theme="getHeaderTheme" /> | ||
45 | - | ||
46 | <AppLocalePicker | 44 | <AppLocalePicker |
47 | v-if="getShowLocale" | 45 | v-if="getShowLocale" |
48 | :reload="true" | 46 | :reload="true" |
49 | :showText="false" | 47 | :showText="false" |
50 | :class="`${prefixCls}-action__item`" | 48 | :class="`${prefixCls}-action__item`" |
51 | /> | 49 | /> |
50 | + | ||
51 | + <UserDropDown :theme="getHeaderTheme" /> | ||
52 | + | ||
53 | + <SettingDrawer v-if="getShowSettingButton" :class="`${prefixCls}-action__item`" /> | ||
52 | </div> | 54 | </div> |
53 | </Header> | 55 | </Header> |
54 | </template> | 56 | </template> |
@@ -76,6 +78,8 @@ | @@ -76,6 +78,8 @@ | ||
76 | import { useAppInject } from '/@/hooks/web/useAppInject'; | 78 | import { useAppInject } from '/@/hooks/web/useAppInject'; |
77 | import { useDesign } from '/@/hooks/web/useDesign'; | 79 | import { useDesign } from '/@/hooks/web/useDesign'; |
78 | 80 | ||
81 | + import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; | ||
82 | + | ||
79 | export default defineComponent({ | 83 | export default defineComponent({ |
80 | name: 'LayoutHeader', | 84 | name: 'LayoutHeader', |
81 | components: { | 85 | components: { |
@@ -90,6 +94,9 @@ | @@ -90,6 +94,9 @@ | ||
90 | Notify, | 94 | Notify, |
91 | AppSearch, | 95 | AppSearch, |
92 | ErrorAction, | 96 | ErrorAction, |
97 | + SettingDrawer: createAsyncComponent(() => import('/@/layouts/default/setting/index.vue'), { | ||
98 | + loading: true, | ||
99 | + }), | ||
93 | }, | 100 | }, |
94 | props: { | 101 | props: { |
95 | fixed: propTypes.bool, | 102 | fixed: propTypes.bool, |
@@ -105,7 +112,7 @@ | @@ -105,7 +112,7 @@ | ||
105 | getIsMixSidebar, | 112 | getIsMixSidebar, |
106 | } = useMenuSetting(); | 113 | } = useMenuSetting(); |
107 | const { getShowLocale } = useLocaleSetting(); | 114 | const { getShowLocale } = useLocaleSetting(); |
108 | - const { getUseErrorHandle } = useRootSetting(); | 115 | + const { getUseErrorHandle, getShowSettingButton } = useRootSetting(); |
109 | 116 | ||
110 | const { | 117 | const { |
111 | getHeaderTheme, | 118 | getHeaderTheme, |
@@ -167,6 +174,7 @@ | @@ -167,6 +174,7 @@ | ||
167 | getUseErrorHandle, | 174 | getUseErrorHandle, |
168 | getLogoWidth, | 175 | getLogoWidth, |
169 | getIsMixSidebar, | 176 | getIsMixSidebar, |
177 | + getShowSettingButton, | ||
170 | }; | 178 | }; |
171 | }, | 179 | }, |
172 | }); | 180 | }); |
src/layouts/default/setting/index.vue
@@ -27,26 +27,3 @@ | @@ -27,26 +27,3 @@ | ||
27 | }, | 27 | }, |
28 | }); | 28 | }); |
29 | </script> | 29 | </script> |
30 | -<style lang="less"> | ||
31 | - @prefix-cls: ~'@{namespace}-setting-button'; | ||
32 | - | ||
33 | - .@{prefix-cls} { | ||
34 | - position: absolute; | ||
35 | - top: 45%; | ||
36 | - right: 0; | ||
37 | - z-index: 10; | ||
38 | - display: flex; | ||
39 | - padding: 10px; | ||
40 | - color: @white; | ||
41 | - cursor: pointer; | ||
42 | - background: @primary-color; | ||
43 | - border-radius: 6px 0 0 6px; | ||
44 | - justify-content: center; | ||
45 | - align-items: center; | ||
46 | - | ||
47 | - svg { | ||
48 | - width: 1em; | ||
49 | - height: 1em; | ||
50 | - } | ||
51 | - } | ||
52 | -</style> |