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
| <template>
| <view>
| <view class="page-header"></view>
| <scroll-view class="page-content">
| </scroll-view>
| <!-- 分页器 -->
| <view class="page-footer"></view>
| </view>
| </template>
|
| <script>
| export default {
| data() {
| return {
| // 滚动控制
| scrollTop: 0,
| old: {
| scrollTop: 0
| }
| }
| },
| methods: {
| goTop: function(e) {
| // 解决view层不同步的问题
| this.scrollTop = this.old.scrollTop
| this.$nextTick(function() {
| this.scrollTop = 0
| });
| }
| }
| }
| </script>
|
| <style>
|
| </style>
|
|