cityIndex.vue 940 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <u-index-list :scrollTop="scrollTop">
  3. <view v-for="(item, index) in indexList" :key="index">
  4. <u-index-anchor :index="item" />
  5. <view class="list-cell">
  6. 列表1
  7. </view>
  8. <view class="list-cell">
  9. 列表2
  10. </view>
  11. <view class="list-cell">
  12. 列表3
  13. </view>
  14. </view>
  15. </u-index-list>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. scrollTop: 0,
  22. indexList: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S",
  23. "T", "U",
  24. "V", "W", "X", "Y", "Z"
  25. ]
  26. }
  27. },
  28. onPageScroll(e) {
  29. this.scrollTop = e.scrollTop;
  30. },
  31. onShow() {
  32. },
  33. onLoad() {
  34. },
  35. methods: {
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .list-cell {
  41. display: flex;
  42. box-sizing: border-box;
  43. width: 100%;
  44. padding: 10px 24rpx;
  45. overflow: hidden;
  46. color: #323233;
  47. font-size: 14px;
  48. line-height: 24px;
  49. background-color: #fff;
  50. }
  51. </style>