|
@@ -0,0 +1,83 @@
|
|
|
+<template>
|
|
|
+ <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-item :index="item.path" v-for="(item,index) in $router.options.routes[1].children"
|
|
|
+ :key="index">
|
|
|
+ <i class="el-icon-setting"></i>
|
|
|
+ <span slot="title">{{item.meta.title}}</span>
|
|
|
+ </el-menu-item>
|
|
|
+ </el-menu>
|
|
|
+ </el-aside>
|
|
|
+ <el-main>
|
|
|
+ <el-header>
|
|
|
+ <tabs></tabs>
|
|
|
+ </el-header>
|
|
|
+ <el-main>
|
|
|
+ <keep-alive :include="includeTabs">
|
|
|
+ <router-view></router-view>
|
|
|
+ </keep-alive>
|
|
|
+ </el-main>
|
|
|
+ </el-main>
|
|
|
+ </el-container>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import tabs from '@/components/tabs'
|
|
|
+ export default {
|
|
|
+ components:{
|
|
|
+ tabs
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ select(e){
|
|
|
+ console.log('点击',e)
|
|
|
+ // this.$store.dispatch('getters')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+ .el-header {
|
|
|
+ background-color: #B3C0D1;
|
|
|
+ color: #333;
|
|
|
+ line-height: 60px;
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-aside {
|
|
|
+ background-color: #D3DCE6;
|
|
|
+ color: #333;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 200px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-main {
|
|
|
+ background-color: #E9EEF3;
|
|
|
+ color: #333;
|
|
|
+ line-height: 160px;
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+</style>
|