From 5a9eed686fe1bf10a095e6b56fbef4188832fe00 Mon Sep 17 00:00:00 2001 From: 13404089107 <puwei@sinata.cn> Date: 星期二, 01 四月 2025 11:35:58 +0800 Subject: [PATCH] Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory --- src/App.vue | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 45 insertions(+), 1 deletions(-) diff --git a/src/App.vue b/src/App.vue index 4292c71..cb1c7fd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,17 +6,50 @@ <script> export default { + name: 'App', + data() { + return { + windowWidth: window.innerWidth, + isCollapse: false + } + }, + watch: { + windowWidth(newWidth) { + // 当窗口宽度小于某个值时,可以触发折叠 + if (newWidth < 1200 && !this.isCollapse) { + this.isCollapse = true + this.$store.commit('SET_ISFOLD', true) + } else if (newWidth >= 1200 && this.isCollapse) { + this.isCollapse = false + this.$store.commit('SET_ISFOLD', false) + } + } + }, created() { + // 初始化时检查窗口大小 + this.handleResize() + }, + mounted() { + // 监听窗口大小变化 + window.addEventListener('resize', this.handleResize) + }, + beforeDestroy() { + // 移除监听 + window.removeEventListener('resize', this.handleResize) }, methods: { + handleResize() { + this.windowWidth = window.innerWidth + } }, } </script> -<style> +<style lang="less"> ::-webkit-scrollbar { display: none; } + html, body, #app { @@ -25,4 +58,15 @@ padding: 0; background-color: rgb(245, 245, 245); } + +.selected { + color: #049C9A !important; +} +.el-button--primary { + background-color: #009688 !important; + border-color: #009688 !important; +} +.el-button--text { + color: #009688 !important; +} </style> -- Gitblit v1.7.1