This commit is contained in:
jiayuqi7813
2022-05-21 23:35:48 +08:00
commit 601d9c2831
20 changed files with 1558 additions and 0 deletions

51
src/components/Navbar.vue Normal file
View File

@@ -0,0 +1,51 @@
<template>
<el-menu
router
:default-active="$route.path"
class="el-menu-demo"
mode="horizontal"
background-color="#2d3039"
text-color="#fff"
active-text-color="#ffd04b"
>
<el-menu-item index="0">
<a href="/home"><img style = "height:50px;width:auto" src="../assets/logo.png" alt="logo"></a>
</el-menu-item>
<el-menu-item index="/home">Home</el-menu-item>
<el-menu-item index="/scoreboard">Scoreboard</el-menu-item>
<el-menu-item index="/users">Users</el-menu-item>
<el-menu-item index="/notification">Notification</el-menu-item>
<el-menu-item index="/challenges">Challenges</el-menu-item>
<el-button type="primary" class="login" @click="login">登录/注册</el-button>
</el-menu>
</template>
<script>
export default {
methods:{
login(){
this.$router.push('/login')
}
}
}
</script>
<style lang="less" scoped>
.login{
margin-top: 12px;
margin-left: auto;
margin-right: 30px;
float:right;
}
</style>