完善导航栏

This commit is contained in:
jiayuqi7813
2022-06-22 01:47:26 +08:00
parent 6f28c0dfb7
commit e84f77b4d3
3 changed files with 91 additions and 37 deletions

View File

@@ -1,53 +1,107 @@
<template> <template>
<div class="category"> <div class="challenges-all">
<el-container> <div class="category">
<el-aside width="200px"> <el-container>
<el-menu <el-aside width="200px">
default-active="2" <el-menu
background-color="#2d3039" default-active="2"
text-color="#fff" background-color="#2d3039"
class="el-menu-vertical-demo" text-color="#fff"
@open="handleOpen" active-text-color="#ffd04b"
@close="handleClose" class="el-menu-vertical-demo"
> @open="handleOpen"
<el-menu-item index="/challenges/web"> @close="handleClose"
<span>WEB</span> @select="handleSelect"
</el-menu-item> >
<el-menu-item index="/challenges/pwn"> <el-menu-item index="Web">
<span>PWN</span> <span>WEB</span>
</el-menu-item> </el-menu-item>
<el-menu-item index="/challenges/misc"> <el-menu-item index="Pwn">
<span>MISC</span> <span>PWN</span>
</el-menu-item> </el-menu-item>
<el-menu-item index="/challenges/reverse"> <el-menu-item index="Misc">
<span>REVERSE</span> <span>MISC</span>
</el-menu-item> </el-menu-item>
<el-menu-item index="/challenges/crypto"> <el-menu-item index="Reverse">
<span>CRYPTO</span> <span>REVERSE</span>
</el-menu-item> </el-menu-item>
</el-menu> <el-menu-item index="Crypto">
</el-aside> <span>CRYPTO</span>
</el-container> </el-menu-item>
</el-menu>
</el-aside>
</el-container>
</div>
<div class="all-card">
<!-- <div v-for="(c,index) in data" class="card" @click="clickcard(index)" ref="card" :key="index" >-->
<!-- <div class="card-name">-->
<!-- {{c.name}}-->
<!-- </div>-->
<!-- <div class="card-score">-->
<!-- {{c.score}}-->
<!-- {{c.description}}-->
<!-- </div>-->
<!-- </div>-->
</div>
</div> </div>
</template> </template>
<script lang="ts" setup> <script>
import { import {
Document, Document,
Menu as IconMenu, Menu as IconMenu,
Location, Location,
Setting, Setting,
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import axios from "axios";
const handleOpen = (key: string, keyPath: string[]) => { export default {
console.log(key, keyPath) data() {
} return {
const handleClose = (key: string, keyPath: string[]) => { challengetype: '',
console.log(key, keyPath) data:[],
}
},
methods: {
clickcard(index){
console.log(this.$refs.card[index].style.backgroundColor="#fff");
},
handleSelect(index) {
this.challengetype = index;
axios.get("/api/v1/user/challenges/" + index).then(res => {
if (res.data.code === 200) {
console.log(res.data)
this.data = res.data.data;
}
})
},
}
} }
</script> </script>
<style>
<style lang="less">
.challenges-all{
display: flex;
.all-card{
width: 10%;
.card{
display: inline-block;
width: 100%;
height: 50px;
background-color: #ff7f00;
border-radius: 10px;
box-shadow: #9e4f00 0px 0px 10px;
margin-left: 10px;
margin-bottom: 30px;
margin-right:10px ;
}
}
}
</style> </style>

View File

@@ -43,7 +43,6 @@ export default {
<style lang="less"> <style lang="less">
.scorecard{ .scorecard{
height: 100%; height: 100%;
width: 100%; width: 100%;

View File

@@ -30,6 +30,7 @@ const router = createRouter({
path:'/scoreboard', path:'/scoreboard',
name:'Scoreboard', name:'Scoreboard',
component: Scoreboard, component: Scoreboard,
} }
] ]
}) })