|
|
<script setup>
|
|
|
import Head from '@/components/head.vue'
|
|
|
import { ref } from 'vue'
|
|
|
import router from '@/router/index';
|
|
|
import router from '@/router/index'
|
|
|
const list = ref([
|
|
|
{ path: '/home', name: '首页' },
|
|
|
{ path: '/', name: '课程' },
|
|
|
{ path: '/note', name: '笔记' },
|
|
|
{ path: '/news', name: '消息' },
|
|
|
{ path: '/disk', name: '云盘' },
|
|
|
{ path: '/address', name: '通讯录' },
|
|
|
{ path: '/account', name: '账号管理' },
|
|
|
{ path: '/manage', name: '班级管理' }
|
|
|
{ id: 1, path: '/home', name: '首页' },
|
|
|
{ id: 2, path: '/', name: '课程' },
|
|
|
{ id: 3, path: '/note', name: '笔记' },
|
|
|
{ id: 4, path: '/news', name: '消息' },
|
|
|
{ id: 5, path: '/disk', name: '云盘' },
|
|
|
{ id: 6, path: '/address', name: '通讯录' },
|
|
|
{ id: 7, path: '/account', name: '账号管理' },
|
|
|
{ id: 8, path: '/manage', name: '班级管理' }
|
|
|
])
|
|
|
const navigator = (path) => {
|
|
|
console.log(path);
|
|
|
const activeIndex = ref(1)
|
|
|
const navigator = (path, id) => {
|
|
|
router.push(path)
|
|
|
|
|
|
console.log(id)
|
|
|
activeIndex.value = id
|
|
|
}
|
|
|
</script>
|
|
|
|
...
|
...
|
@@ -31,7 +32,14 @@ const navigator = (path) => { |
|
|
</div>
|
|
|
<div class="name">XXX</div>
|
|
|
<div class="cont">
|
|
|
<div class="li" v-for="item in list" :key="item" @click="navigator(item.path)">{{ item.name }}</div>
|
|
|
<div
|
|
|
v-for="(item, index) in list"
|
|
|
:key="item"
|
|
|
@click="navigator(item.path, index)"
|
|
|
:class="{ 'active': activeIndex === index, 'li': true }"
|
|
|
>
|
|
|
{{ item.name }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="one"></div>
|
|
|
</div>
|
...
|
...
|
@@ -45,7 +53,9 @@ const navigator = (path) => { |
|
|
</template>
|
|
|
<style lang="scss" scoped>
|
|
|
.counter {
|
|
|
background-color: #f2f2f2;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
|
|
|
.banner {
|
|
|
display: flex;
|
|
|
|
...
|
...
|
@@ -80,9 +90,6 @@ const navigator = (path) => { |
|
|
padding-left: 30px;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.li:hover {
|
|
|
background-color: #4d5cb6;
|
|
|
}
|
|
|
.active {
|
|
|
background-color: #4d5cb6;
|
|
|
}
|
...
|
...
|
|