issue-16938.uvue 757 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <list-view ref="list" style="flex: 1;">
  3. <list-item class="item" v-for="item in 1000" @click="toNextPage">
  4. {{item}}点击跳转下一页
  5. </list-item>
  6. </list-view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. scrollTop: 0
  13. }
  14. },
  15. onLoad() {
  16. },
  17. onReady() {
  18. },
  19. methods: {
  20. toNextPage() {
  21. uni.navigateTo({
  22. url: '/pages/component/list-view/list-view'
  23. })
  24. },
  25. getScrollTop() {
  26. return (this.$refs['list'] as UniListViewElement).scrollTop
  27. },
  28. setScrollTop(top: number) {
  29. (this.$refs['list'] as UniListViewElement).scrollTop = top
  30. }
  31. }
  32. }
  33. </script>
  34. <style>
  35. .item {
  36. height: 100px;
  37. }
  38. </style>