-
Notifications
You must be signed in to change notification settings - Fork 0
/
11.vue
55 lines (52 loc) · 999 Bytes
/
11.vue
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
<template>
<view class="container">
<view class="btn">
<view :data-id="item" v-for="item in list" @tap="bindToView">{{
item
}}</view>
</view>
<scroll-view
class="scroller"
:scroll-into-view="toView"
scroll-y="true"
scroll-with-animation="true"
>
<view :id="item" class="left" v-for="item in list">{{ item }}</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
list: ["薛之谦", "任然", "张靓颖", "周杰伦"],
toView: "",
};
},
methods: {
bindToView(event) {
var id = event.currentTarget.dataset.id;
console.log(id);
this.toView = id;
},
},
};
</script>
<style lang="scss">
.container {
width: 100%;
.btn {
padding: 50px 0px;
width: 100%;
display: flex;
justify-content: space-around;
}
scroll-view {
height: 90vh;
.left {
font-size: 50rpx;
line-height: 200rpx;
}
}
}
</style>