123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <template>
- <div class="bottom">
- <!-- <div
- class="item"
- @click="clickItem('/')"
- :class="{ active: $route.path === '/' }"
- >
- <p>首页</p>
- </div>
- <div
- class="item"
- @click="clickItem('/b')"
- :class="{ active: $route.path === '/b' }"
- >
- <p>学习中心</p>
- </div> -->
- <el-aside style="width: 180px; font-size: 16px">
- <el-row class="tac">
- <el-col :span="12">
- <el-menu
- :default-active="path"
- background-color="#fff"
- text-color="#777"
- active-text-color="#fff"
- router
- style="text-align: left"
- >
- <el-menu-item index="/">
- <div class="img" style="padding-bottom: 5px" v-if="path == '/'">
- <img src="../../assets/icon/home-active.png" alt="" />
- </div>
- <div class="img" style="padding-bottom: 5px" v-else>
- <img src="../../assets/icon/home.png" alt="" />
- </div>
- <span>首页管理</span>
- </el-menu-item>
- <el-menu-item index="/curriculum">
- <div class="img" v-if="path == '/curriculum'">
- <img src="../../assets/icon/course-active.png" alt="" />
- </div>
- <div class="img" v-else>
- <img src="../../assets/icon/course.png" alt="" />
- </div>
- <span slot="title">课程管理</span>
- </el-menu-item>
- <el-menu-item index="/template">
- <div class="img" v-if="path == '/template'">
- <img src="../../assets/icon/works-active.png" alt="" />
- </div>
- <div class="img" v-else>
- <img src="../../assets/icon/works.png" alt="" />
- </div>
- <span slot="title">模板管理</span>
- </el-menu-item>
- <el-menu-item index="/notice">
- <div class="img" v-if="path == '/notice'">
- <img src="../../assets/icon/notice-active.png" alt="" />
- </div>
- <div class="img" v-else>
- <img src="../../assets/icon/notice.png" alt="" />
- </div>
- <span slot="title">通知公告</span>
- </el-menu-item>
- <el-menu-item index="/grouping">
- <div class="img" v-if="path == '/grouping'">
- <img src="../../assets/icon/group-active.png" alt="" />
- </div>
- <div class="img" v-else>
- <img src="../../assets/icon/group.png" alt="" />
- </div>
- <span slot="title">分组管理</span>
- </el-menu-item>
- <el-menu-item index="/organization">
- <div class="img" v-if="path == '/organization'">
- <img src="../../assets/icon/class-active.png" alt="" />
- </div>
- <div class="img" v-else>
- <img src="../../assets/icon/class.png" alt="" />
- </div>
- <span slot="title">组织管理</span>
- </el-menu-item>
- <el-menu-item index="/class">
- <div class="img" v-if="path == '/class'">
- <img src="../../assets/icon/class-active.png" alt="" />
- </div>
- <div class="img" v-else>
- <img src="../../assets/icon/class.png" alt="" />
- </div>
- <span slot="title">班级管理</span>
- </el-menu-item>
- </el-menu>
- </el-col>
- </el-row>
- </el-aside>
- </div>
- </template>
- <script>
- export default {
- props: {
- luyou: Number,
- },
- data() {
- return {
- path: this.$route.path,
- };
- },
- methods: {
- clickItem: function (path) {
- this.$router.push(path);
- },
- },
- watch: {
- luyou: {
- handler(n, o) {
- this.path = this.$route.path;
- },
- deep: true, // 深度监听父组件传过来对象变化
- },
- },
- };
- </script>
- <style scoped>
- .bottom {
- position: absolute;
- left: 20px;
- margin-top: 20px;
- background-color: #fff;
- width: 180px;
- height: calc(100% - 100px);
- min-height: 500px;
- z-index: 999;
- display: inline-block;
- border-radius: 5px;
- overflow: hidden;
- }
- .item {
- margin: 5px 20%;
- float: left;
- }
- .item p {
- margin: 0;
- font-size: 15px;
- }
- .active {
- color: #108b70;
- }
- .bottom >>> .el-menu-item.is-active {
- background: #3d67bc !important;
- }
- .tac >>> .el-col-12 {
- width: 100%;
- }
- .tac >>> .el-menu {
- border-right: none;
- }
- .tac >>> .el-menu-item {
- display: flex;
- /* justify-content: center; */
- align-items: center;
- font-size: 16px;
- padding-left: 40px !important;
- }
- .img {
- width: 20px;
- padding-right: 5px;
- /* padding-bottom: 5px; */
- }
- .img > img {
- width: 100%;
- height: 100%;
- }
- </style>
|