|
@@ -2,7 +2,8 @@
|
|
|
<div class="">
|
|
|
<el-container>
|
|
|
<el-aside width="180px">
|
|
|
- <el-menu @select='select' :default-active="$route.path" router class="el-menu-vertical-demo" background-color="#545c64" text-color="#fff">
|
|
|
+ <el-menu :default-active="$route.path" router class="el-menu-vertical-demo" background-color="#545c64"
|
|
|
+ text-color="#fff">
|
|
|
<el-menu-item :index="item.path" v-for="(item,index) in $router.options.routes[1].children"
|
|
|
:key="index">
|
|
|
<i class="el-icon-setting"></i>
|
|
@@ -10,16 +11,16 @@
|
|
|
</el-menu-item>
|
|
|
</el-menu>
|
|
|
</el-aside>
|
|
|
- <el-main>
|
|
|
- <el-header>
|
|
|
+ <div style="flex: 1;">
|
|
|
+ <div style="">
|
|
|
<tabs></tabs>
|
|
|
- </el-header>
|
|
|
+ </div>
|
|
|
<el-main>
|
|
|
<keep-alive :include="includeTabs">
|
|
|
<router-view></router-view>
|
|
|
</keep-alive>
|
|
|
</el-main>
|
|
|
- </el-main>
|
|
|
+ </div>
|
|
|
</el-container>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -27,34 +28,18 @@
|
|
|
<script>
|
|
|
import tabs from '@/components/tabs'
|
|
|
export default {
|
|
|
- components:{
|
|
|
+ components: {
|
|
|
tabs
|
|
|
},
|
|
|
- computed:{
|
|
|
- },
|
|
|
+ computed: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- includeTabs:localStorage.getItem('includeTabs'),
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- '$route': {
|
|
|
- handler(to, from){
|
|
|
- console.log('打印',localStorage.getItem('includeTabs'))
|
|
|
- if (this.includeTabs.indexOf(to.name)==-1) {//不存在
|
|
|
- // var arr = localStorage.getItem('includeTabs')
|
|
|
- // arr.push(to.name)
|
|
|
- // localStorage.setItem('includeTabs',arr)
|
|
|
- }
|
|
|
- },
|
|
|
- immediate:true
|
|
|
+ includeTabs: this.$store.state.includeTabs,
|
|
|
}
|
|
|
},
|
|
|
- methods:{
|
|
|
- select(e){
|
|
|
- console.log('点击',e)
|
|
|
- // this.$store.dispatch('getters')
|
|
|
- }
|
|
|
+ mounted() {
|
|
|
+ this.includeTabs = this.$store.state.includeTabs
|
|
|
+ console.log('tanb', this.$store.state.tabList, this.$store.state.includeTabs)
|
|
|
},
|
|
|
}
|
|
|
</script>
|