'admin-21.04.28:修复themeConfig.js设置默认布局不生效的问题'

This commit is contained in:
lyt-Top
2021-04-28 20:37:09 +08:00
parent 110482c3fb
commit a2f5eb107a
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@
</template>
<script>
import { getLocal } from '@/utils/storage.js';
import { getLocal, setLocal } from '@/utils/storage.js';
export default {
name: 'layout',
components: {
@ -28,6 +28,7 @@ export default {
methods: {
// 窗口大小改变时(适配移动端)
onLayoutResize() {
if (!getLocal('oldLayout')) setLocal('oldLayout', this.$store.state.themeConfig.themeConfig.layout);
const clientWidth = document.body.clientWidth;
if (clientWidth < 1000) {
this.$store.state.themeConfig.themeConfig.isCollapse = false;

View File

@ -196,7 +196,6 @@ export default {
created() {
// 监听窗口大小改变,非默认布局,设置成默认布局(适配移动端)
this.bus.$on('layoutMobileResize', (res) => {
if (this.$store.state.themeConfig.themeConfig.layout === res.layout) return false;
this.$store.state.themeConfig.themeConfig.layout = res.layout;
this.$store.state.themeConfig.themeConfig.isDrawer = false;
this.$store.state.themeConfig.themeConfig.isCollapse = false;