@@ -205,9 +210,23 @@ export default {
},
data() {
this.onlyOneChild = null
- return {}
+ return {
+ keyIndex: 0
+ }
+ },
+ watch:{
+ $route () {
+ // 监控用户点击的菜单,如果是首页或者个人详情页面都要把上次打开的页面收缩起来。
+ if (this.$route.path == '/index') {
+ this.$refs.menu.close(this.keyIndex);
+ this.$refs.subMenu.close(this.keyIndex);
+ }
+ }
},
methods: {
+ handleOpen(key) {
+ this.keyIndex = key;
+ },
hasOneShowingChild(children = [], parent) {
console.log('212')
if (!children) {
diff --git a/fuintAdmin_zt/src/layout/components/Sidebar/index.vue b/fuintAdmin_zt/src/layout/components/Sidebar/index.vue
index e7ea0bdd2..270a2b51b 100644
--- a/fuintAdmin_zt/src/layout/components/Sidebar/index.vue
+++ b/fuintAdmin_zt/src/layout/components/Sidebar/index.vue
@@ -1,116 +1,140 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+ :default-active="activeMenu"
+ :collapse="isCollapse"
+ :background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
+ :text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
+ :unique-opened="true"
+ :active-text-color="settings.theme"
+ :collapse-transition="false"
+ mode="vertical"
+ style="margin-bottom: 80px;"
+ ref="menu"
+ @open="handleOpen"
+ >
+
+
+
+