Commit 53571b9e authored by caixingbing's avatar caixingbing

*

parent a4c91c10
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<i slot="prefix" class="el-input__icon el-icon-search" @click="handleSearch"></i> <i slot="prefix" class="el-input__icon el-icon-search" @click="handleSearch"></i>
</el-input> </el-input>
<el-menu <el-menu
default-active="1" :default-active="routeIndex"
class="detail-menu" class="detail-menu"
@open="handleOpen"> @open="handleOpen">
<template v-for="(item, index) in sideRoute"> <template v-for="(item, index) in sideRoute">
...@@ -31,6 +31,10 @@ export default { ...@@ -31,6 +31,10 @@ export default {
type: Number, type: Number,
default: null default: null
}, },
pathName: {
type: String,
default: null
},
}, },
data() { data() {
return { return {
...@@ -93,6 +97,23 @@ export default { ...@@ -93,6 +97,23 @@ export default {
sideHeight = null sideHeight = null
} }
return sideHeight return sideHeight
},
routeIndex(){
let idx = '0-0', sideArr = this.sideRoute
for(let i=0; i < sideArr.length; i++){
if(sideArr[i].pathName == this.pathName){
idx = i.toString()
break
}else if(sideArr[i].children){
for(let j=0; j< sideArr[i].children.length ; j++){
if(sideArr[i].children.pathName == this.pathName){
idx = i+'-'+j
break
}
}
}
}
return idx
} }
}, },
created() { created() {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<Header :company-id="companyId" v-if="companyId" /> <Header :company-id="companyId" v-if="companyId" />
<div class="flex-box part-main"> <div class="flex-box part-main">
<div class="part-left"> <div class="part-left">
<side-bar @currentPath="showPartPage" :partBoxHeight="partBoxHeight" /> <side-bar @currentPath="showPartPage" :pathName="currentPath.pathName" :partBoxHeight="partBoxHeight" />
</div> </div>
<div class="part-right"> <div class="part-right">
<div id="partBox" v-if="companyId"> <div id="partBox" v-if="companyId">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment