mirror of
https://gitee.com/lyt-top/vue-next-admin
synced 2026-07-04 13:02:39 +08:00
'admin-21.04.28:修复themeConfig.js设置默认布局不生效的问题'
This commit is contained in:
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user