diff --git a/src/page/index/index.vue b/src/page/index/index.vue index ec277bf..dd0fbd0 100644 --- a/src/page/index/index.vue +++ b/src/page/index/index.vue @@ -1,16 +1,17 @@ @@ -82,6 +75,7 @@ export default { data() { return { isCollapse: false, + showRight:false // selectIndex:0 } }, @@ -100,6 +94,7 @@ export default { mounted() { console.log('left--------------------------',this.leftMenu) console.log('menu--------------------------',this.menu) + console.log('selectIndex--------------------------',this.selectIndex) if(this.setting.styleRadio=='3'){ this.index.openMenu2(); }else{ @@ -113,9 +108,9 @@ export default { path: item.path, query: item.query, }); + this.$store.commit('SET_SELECT_INDEX', index); + this.$store.commit('SET_SELECTED_INDEX', item.id + ''); } - this.$store.commit('SET_SELECTED_INDEX', item.id + ''); - this.$store.commit('SET_SELECT_INDEX', index); // this.selectIndex = index }, clickPage(item) { @@ -124,24 +119,72 @@ export default { path: item.path, query: item.query, }); - this.$store.commit('SET_SELECTED_INDEX', item.parentId + ''); + // this.$store.commit('SET_SELECTED_INDEX', item.parentId + ''); + } + }, + mouseEnter(item,index){ + this.$store.commit('SET_SELECT_INDEX', index); + if(item.children){ + this.showRight = true + }else{ + this.showRight = false + } + }, + mounseLeave(item,item1){ + console.log('item----------------------',item) + console.log('item1----------------------',item1) + console.log('tmp-------------------',item.children.find(item1 => item1.children)) + if(!item1.children){ + if(item.id != this.selectedIndex){ + let tmp = this.leftMenu.find(item => item.id == this.selectedIndex) + let tmpIndex = this.leftMenu.findIndex(item => item.id == this.selectedIndex) + this.$store.commit('SET_SELECT_INDEX', tmpIndex == -1 ? 0 : tmpIndex); + if(tmp && tmp.children){ + this.showRight = true + }else{ + this.showRight = false + } + } + } + + }, + handleClick(item){ + console.log('item000000000000000000000000',item) + if(!item.children){ + this.$router.push({ + path: item.path, + query: item.query, + }); } } }, + + }; diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue index cf0abe8..30c2c27 100644 --- a/src/page/index/top/index.vue +++ b/src/page/index/top/index.vue @@ -1,15 +1,19 @@