You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
1.7 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <vue-seamless-scroll :data="listData" :class-option="classOption" class="warp">
  3. <ul class="item">
  4. <li v-for="(item, index) in listData" :key="index">
  5. <view class="content">
  6. <span class="title" v-text="item.title"></span>
  7. <span class="date" v-text="item.date"></span>
  8. </view>
  9. </li>
  10. </ul>
  11. </vue-seamless-scroll>
  12. </template>
  13. <script>
  14. import vueSeamlessScroll from 'vue-seamless-scroll'
  15. export default {
  16. name: 'Example01Basic',
  17. components: {
  18. vueSeamlessScroll
  19. },
  20. data() {
  21. return {
  22. listData: [{
  23. 'title': 'Get a commission',
  24. 'date': '666'
  25. }, {
  26. 'title': 'Get a commission16'
  27. }, {
  28. 'title': 'Get a commission',
  29. 'date': '777'
  30. }, {
  31. 'title': 'Get a commission',
  32. 'date': '888'
  33. }, {
  34. 'title': 'Get a commission',
  35. 'date': '999'
  36. }, {
  37. 'title': 'Get a commission',
  38. 'date': '111'
  39. }, {
  40. 'title': 'Get a commission',
  41. 'date': '222'
  42. }, {
  43. 'title': 'Get a commission',
  44. 'date': '333'
  45. }, {
  46. 'title': 'Get a commission',
  47. 'date': '4444'
  48. }],
  49. classOption: {
  50. step: .5
  51. }
  52. }
  53. },
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .warp {
  58. height: 100%;
  59. width: 80%;
  60. margin: 0 auto;
  61. overflow: hidden;
  62. ul {
  63. list-style: none;
  64. padding: 0;
  65. margin: 0 auto;
  66. li,
  67. a {
  68. display: flex;
  69. align-items: center;
  70. height: 60rpx;
  71. justify-content: space-between;
  72. font-size: 15px;
  73. border-radius: 15rpx;
  74. overflow: hidden;
  75. .content {
  76. height: 50rpx;
  77. width: 100%;
  78. background: rgba(255, 255, 255, .5);
  79. box-sizing: border-box;
  80. padding: 0rpx 10% 0rpx 30%;
  81. span{
  82. margin-left: 15rpx;
  83. }
  84. }
  85. }
  86. }
  87. }
  88. </style>