letter-list.vue
898 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
39
40
41
42
43
44
45
46
47
48
<template>
<ul class="list-box">
<li v-for="item in items"><a href="#{{item.id}}">{{item.name}}</a></li>
</ul>
</template>
<style>
body {
background: #000;
}
.list-box {
position: fixed;
height: 100%;
width: 30px;
margin: 0;
padding: 6px;
right: 0;
border-radius: 8px;
background: #fff;
opacity: 0.8;
li {
list-style: none;
}
}
</style>
<script>
var $ = require('yoho-jquery');
module.exports = {
data: function () {
return {
items: []
}
},
init() {
$.ajax({
url: '/brand/letterList'
}).then(result => {
this.items = result;
}).fail(() => {
tip('网络错误');
});
}
};
</script>