App.vue
1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<template>
<div id="app">
<div class="wrapper-header">
<img class="logo" src="./assets/logo.png" alt="" />
<a-menu v-model="current" mode="horizontal">
<a-menu-item key="folder" @click="handleTab('Folder')"
><a-icon type="home" />项目主页</a-menu-item
>
<a-menu-item key="documentation" @click="handleTab('Documentation')"
><a-icon type="file-text" />项目文档描述</a-menu-item
>
<a-menu-item key="record" @click="handleTab('Record')"
><a-icon type="message" />问题记录</a-menu-item
>
</a-menu>
</div>
<div class="wrapper-content">
<router-view />
</div>
</div>
</template>
<script>
let currentName = "";
export default {
name: "App",
data() {
return {
current: ["folder"],
};
},
mounted() {
currentName = window.location.pathname.substr(1);
console.log(currentName);
if (!currentName) this.current = ["folder"];
else this.current = [currentName];
},
methods: {
handleTab(name) {
this.to(name);
},
},
};
</script>
<style>
.wrapper-header {
display: flex;
background-color: #2b303b;
}
.wrapper-header .logo {
display: inline-flex;
width: 50px;
height: 50px;
}
.wrapper-header .ant-menu {
display: inline-flex;
background-color: #2b303b;
color: #fff;
}
.wrapper-header .ant-menu-horizontal > .ant-menu-item:hover,
.wrapper-header .ant-menu-horizontal > .ant-menu-item-active,
.wrapper-header .ant-menu-horizontal > .ant-menu-item-selected {
border-bottom: none;
}
.wrapper-header .ant-menu-horizontal {
border-bottom: none;
}
.wrapper-header .ant-menu-horizontal > .ant-menu-item > a {
color: #fff;
}
.wrapper-content {
margin: 30px auto;
padding: 0 10px;
max-width: 1300px;
}
</style>