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 | 1 | <template> |
2 | 2 | <LayoutLockPage /> |
3 | 3 | <BackTop v-if="getUseOpenBackTop" :target="getTarget" /> |
4 | - <SettingDrawer v-if="getShowSettingButton" /> | |
5 | 4 | </template> |
6 | 5 | <script lang="ts"> |
7 | 6 | import { defineComponent } from 'vue'; |
... | ... | @@ -14,15 +13,13 @@ |
14 | 13 | components: { |
15 | 14 | BackTop, |
16 | 15 | LayoutLockPage: createAsyncComponent(() => import('/@/views/sys/lock/index.vue')), |
17 | - SettingDrawer: createAsyncComponent(() => import('/@/layouts/default/setting/index.vue')), | |
18 | 16 | }, |
19 | 17 | setup() { |
20 | - const { getUseOpenBackTop, getShowSettingButton } = useRootSetting(); | |
18 | + const { getUseOpenBackTop } = useRootSetting(); | |
21 | 19 | |
22 | 20 | return { |
23 | 21 | getTarget: () => document.body, |
24 | 22 | getUseOpenBackTop, |
25 | - getShowSettingButton, | |
26 | 23 | }; |
27 | 24 | }, |
28 | 25 | }); | ... | ... |
src/layouts/default/header/index.less
1 | 1 | @header-trigger-prefix-cls: ~'@{namespace}-layout-header-trigger'; |
2 | 2 | @header-prefix-cls: ~'@{namespace}-layout-header'; |
3 | -@locale-prefix-cls: ~'@{namespace}-app-locale-picker'; | |
4 | 3 | @breadcrumb-prefix-cls: ~'@{namespace}-layout-breadcrumb'; |
5 | 4 | @logo-prefix-cls: ~'@{namespace}-app-logo'; |
6 | 5 | |
... | ... | @@ -104,7 +103,7 @@ |
104 | 103 | &-action { |
105 | 104 | display: flex; |
106 | 105 | min-width: 180px; |
107 | - padding-right: 12px; | |
106 | + // padding-right: 12px; | |
108 | 107 | align-items: center; |
109 | 108 | |
110 | 109 | &__item { |
... | ... | @@ -146,13 +145,15 @@ |
146 | 145 | |
147 | 146 | .@{header-prefix-cls}-action { |
148 | 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 | 41 | |
42 | 42 | <FullScreen v-if="getShowFullScreen" :class="`${prefixCls}-action__item fullscreen-item`" /> |
43 | 43 | |
44 | - <UserDropDown :theme="getHeaderTheme" /> | |
45 | - | |
46 | 44 | <AppLocalePicker |
47 | 45 | v-if="getShowLocale" |
48 | 46 | :reload="true" |
49 | 47 | :showText="false" |
50 | 48 | :class="`${prefixCls}-action__item`" |
51 | 49 | /> |
50 | + | |
51 | + <UserDropDown :theme="getHeaderTheme" /> | |
52 | + | |
53 | + <SettingDrawer v-if="getShowSettingButton" :class="`${prefixCls}-action__item`" /> | |
52 | 54 | </div> |
53 | 55 | </Header> |
54 | 56 | </template> |
... | ... | @@ -76,6 +78,8 @@ |
76 | 78 | import { useAppInject } from '/@/hooks/web/useAppInject'; |
77 | 79 | import { useDesign } from '/@/hooks/web/useDesign'; |
78 | 80 | |
81 | + import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; | |
82 | + | |
79 | 83 | export default defineComponent({ |
80 | 84 | name: 'LayoutHeader', |
81 | 85 | components: { |
... | ... | @@ -90,6 +94,9 @@ |
90 | 94 | Notify, |
91 | 95 | AppSearch, |
92 | 96 | ErrorAction, |
97 | + SettingDrawer: createAsyncComponent(() => import('/@/layouts/default/setting/index.vue'), { | |
98 | + loading: true, | |
99 | + }), | |
93 | 100 | }, |
94 | 101 | props: { |
95 | 102 | fixed: propTypes.bool, |
... | ... | @@ -105,7 +112,7 @@ |
105 | 112 | getIsMixSidebar, |
106 | 113 | } = useMenuSetting(); |
107 | 114 | const { getShowLocale } = useLocaleSetting(); |
108 | - const { getUseErrorHandle } = useRootSetting(); | |
115 | + const { getUseErrorHandle, getShowSettingButton } = useRootSetting(); | |
109 | 116 | |
110 | 117 | const { |
111 | 118 | getHeaderTheme, |
... | ... | @@ -167,6 +174,7 @@ |
167 | 174 | getUseErrorHandle, |
168 | 175 | getLogoWidth, |
169 | 176 | getIsMixSidebar, |
177 | + getShowSettingButton, | |
170 | 178 | }; |
171 | 179 | }, |
172 | 180 | }); | ... | ... |
src/layouts/default/setting/index.vue
... | ... | @@ -27,26 +27,3 @@ |
27 | 27 | }, |
28 | 28 | }); |
29 | 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> | ... | ... |