side.vue
743 Bytes
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
<template>
<div class="side">
<ul>
<li v-for="item in navs" @click="handleClick(item.path)">
{{item.name}}
</li>
</ul>
</div>
</template>
<script>
export default {
data () {
return {
navs: [
{name: '读者列表', path: '/reader'},
{name: '图书列表', path: '/book'}
]
}
},
methods: {
handleClick (path) {
this.$router.push(path);
}
}
}
</script>
<style>
.side {
width: 200px;
height: 500px;
background-color: rgb(184, 160, 131)
}
ul li {
cursor: pointer;
}
</style>