|
|
@ -3,12 +3,13 @@ |
|
|
|
<ul style="margin: 0;"> |
|
|
|
<li v-for="(item, index) in menuList" :key="item.path + random()"> |
|
|
|
<div |
|
|
|
:class="[($route.path == item.path) || (item.noToPath && curIndex == index) ? 'active' : '', 'flex', ($route.path == item.path) ? curIndex = index : '']" @click="gotoPath(item, index)"> |
|
|
|
<SvgIcon1 :iconPath="require(`@/assets/${item.img}`)" defaultColor="#8A9099" :size="16" activeColor="#006AFF" |
|
|
|
:isActive="($route.path == item.path || (item.noToPath && curIndex == index))" /> |
|
|
|
:class="[($route.path == item.path) || (!item.path && curIndex == index) ? 'active' : '', 'flex', ($route.path == item.path) ? curIndex = index : '']" @click="gotoPath(item, index)"> |
|
|
|
<SvgIcon1 :iconPath="require(`@/assets/${item.img}`)" defaultColor="#8A9099" :size="16" activeColor="#006AFF" |
|
|
|
:isActive="($route.path == item.path || (!item.path && curIndex == index))" /> |
|
|
|
|
|
|
|
<span class="title_text">{{ item.name }}</span> |
|
|
|
</div> |
|
|
|
<p :class="['flex', activeFloor == item1.desc ? 'curActive' : '']" v-for="(item1) in item.list" |
|
|
|
<p :class="['flex', (activeFloor == item1.desc || activeFloor == item1.path) ? 'curActive' : '']" v-for="(item1) in item.list" |
|
|
|
@click="setActiveCur(item1, item,index)" :key="item1.name">{{ item1.name }}</p> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
@ -57,7 +58,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.activeFloor = this.menuList[this.curIndex]?.list?.[0]?.desc; |
|
|
|
this.activeFloor = this.menuList[this.curIndex]?.list?.[0]?.desc || this.menuList[this.curIndex]?.list?.[0]?.path; |
|
|
|
this.componentsName = this.menuList[this.curIndex]?.list?.[0]?.componentsName; |
|
|
|
this.$nextTick(() => { |
|
|
|
// 更可靠的获取滚动容器方式 |
|
|
@ -207,9 +208,14 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
this.scrollLock = true; |
|
|
|
this.activeFloor = item1.desc; |
|
|
|
if(item1.desc){ |
|
|
|
this.activeFloor = item1.desc; |
|
|
|
} |
|
|
|
// 如果 二级路由存在跳转 那么不再进行页面的滚动 |
|
|
|
if(item1.path)return |
|
|
|
if(item1.path){ |
|
|
|
this.activeFloor = item1.path; |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
this.setHighActive(item1.desc); |
|
|
|