[Asm] 纯文本查看 复制代码
<template>
<el-container style="height: 100%;" >
<el-header style="background-color: white;height: 80px" class="brd">
<div>
<el-avatar size="large" :src="avatarURL"></el-avatar>
<span style="color: black">测试系统</span>
</div>
</el-header>
<el-container class="brd" style="margin-top: 2px">
<el-aside width="230px" style="background-color: white" class="brd">
<el-menu
unique-opened
router
default-active="/Test"
class="el-menu-vertical-demo"
>
<el-submenu :index="index" v-for="(value, index) in data">
<template slot="title">
<i :class="value.icon"></i>
<span>{{ value.name }}</span>
</template>
<el-menu-item v-for="(value, index) in value.item" :index="value.path">{{value.name}}</el-menu-item>
</el-submenu>
</el-menu>
</el-aside>
<el-main>
<router-view></router-view>
</el-main>
</el-container>
</el-container>
</template>
<script>
import avatarURL from '../assets/login.jpg'
export default {
name: "Home",
methods:{
},
created() {
},
data(){
return{
avatarURL: avatarURL,
data:[
{icon: "el-icon-user",name: "基本操作",item: [
{path: "/test",name: "测试"},
{path: "/test1",name: "测试1"},
{path: "/test2",name: "测试2"},
]},
{icon: "el-icon-user",name: "基本操作",item: [
{path: "/test",name: "测试"},
{path: "/test1",name: "测试1"},
{path: "/test2",name: "测试2"},
]},
{icon: "el-icon-user",name: "基本操作",item: [
{path: "/test",name: "测试"},
{path: "/test1",name: "测试1"},
{path: "/test2",name: "测试2"},
]},
{icon: "el-icon-user",name: "基本操作",item: [
{path: "/test",name: "测试"},
{path: "/test1",name: "测试1"},
{path: "/test2",name: "测试2"},
]},
{icon: "el-icon-user",name: "基本操作",item: [
{path: "/test",name: "测试"},
{path: "/test1",name: "测试1"},
{path: "/test2",name: "测试2"},
]},
{icon: "el-icon-user",name: "基本操作",item: [
{path: "/test",name: "测试"},
{path: "/test1",name: "测试1"},
{path: "/test2",name: "测试2"},
]},
{icon: "el-icon-user",name: "基本操作",item: [
{path: "/test",name: "测试"},
{path: "/test1",name: "测试1"},
{path: "/test2",name: "测试2"},
]},
]
}
}
}
</script>
<style lang="less" scoped>
.el-header{
background-color: #373d41;
display: flex;
justify-content: space-between;
padding-left: 0;
align-items: center;
color: #dddddd;
font-size: 20px;
> div{
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
span{
margin-left: 15px;
}
img{
height: 100%;
}
}
}
.el-aside{
background-color: #333744;
.el-menu{
border-right: none;
}
}
.el-man{
background-color: #eaedf1;
}
.brd{
box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)
}
</style>