'admin-21.04.28:修复themeConfig.ts设置默认布局不生效的问题'
This commit is contained in:
parent
b240c9d8e9
commit
6517b843ae
@ -8,7 +8,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, onBeforeMount, onUnmounted, getCurrentInstance } from 'vue';
|
import { computed, onBeforeMount, onUnmounted, getCurrentInstance } from 'vue';
|
||||||
import { useStore } from '/@/store/index.ts';
|
import { useStore } from '/@/store/index.ts';
|
||||||
import { getLocal } from '/@/utils/storage.ts';
|
import { getLocal, setLocal } from '/@/utils/storage.ts';
|
||||||
import Defaults from '/@/views/layout/main/defaults.vue';
|
import Defaults from '/@/views/layout/main/defaults.vue';
|
||||||
import Classic from '/@/views/layout/main/classic.vue';
|
import Classic from '/@/views/layout/main/classic.vue';
|
||||||
import Transverse from '/@/views/layout/main/transverse.vue';
|
import Transverse from '/@/views/layout/main/transverse.vue';
|
||||||
@ -25,6 +25,7 @@ export default {
|
|||||||
});
|
});
|
||||||
// 窗口大小改变时(适配移动端)
|
// 窗口大小改变时(适配移动端)
|
||||||
const onLayoutResize = () => {
|
const onLayoutResize = () => {
|
||||||
|
if (!getLocal('oldLayout')) setLocal('oldLayout', getThemeConfig.value.layout);
|
||||||
const clientWidth = document.body.clientWidth;
|
const clientWidth = document.body.clientWidth;
|
||||||
if (clientWidth < 1000) {
|
if (clientWidth < 1000) {
|
||||||
getThemeConfig.value.isCollapse = false;
|
getThemeConfig.value.isCollapse = false;
|
||||||
|
@ -602,7 +602,6 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
// 监听窗口大小改变,非默认布局,设置成默认布局(适配移动端)
|
// 监听窗口大小改变,非默认布局,设置成默认布局(适配移动端)
|
||||||
proxy.mittBus.on('layoutMobileResize', (res: any) => {
|
proxy.mittBus.on('layoutMobileResize', (res: any) => {
|
||||||
if (getThemeConfig.value.layout === res.layout) return false;
|
|
||||||
getThemeConfig.value.layout = res.layout;
|
getThemeConfig.value.layout = res.layout;
|
||||||
getThemeConfig.value.isDrawer = false;
|
getThemeConfig.value.isDrawer = false;
|
||||||
initSetLayoutChange();
|
initSetLayoutChange();
|
||||||
|
Loading…
Reference in New Issue
Block a user