list-scroll.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <vue-seamless-scroll :data="listData" class="warp">
  3. <ul class="item">
  4. <li v-for="(item, index) in listData" :key="index">
  5. <span class="name">{{ item.userName }}</span>
  6. <span class="title">{{ item.fullName }}</span>
  7. <span class="date">{{ item.createTimeStr }}</span>
  8. </li>
  9. </ul>
  10. </vue-seamless-scroll>
  11. </template>
  12. <script>
  13. import vueSeamlessScroll from 'vue-seamless-scroll'
  14. import { winningList } from "@/api/allApi";
  15. export default {
  16. name: 'Example01Basic',
  17. components: {
  18. vueSeamlessScroll
  19. },
  20. props:['listData'],
  21. data() {
  22. return {
  23. }
  24. },
  25. created() {
  26. },
  27. methods: {
  28. },
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .warp {
  33. height: 200px;
  34. width: 100%;
  35. margin: 0 auto;
  36. overflow: hidden;
  37. position: relative;
  38. z-index: 10;
  39. background: url(@/assets/image/zjmd.jpg) no-repeat;
  40. background-size: 100% 100%;
  41. width: 260px;
  42. height: 200px;
  43. ul {
  44. list-style: none;
  45. padding: 0;
  46. margin: 0 auto;
  47. li {
  48. color: #fff;
  49. display: block;
  50. height: 50px;
  51. display: flex;
  52. align-items: center;
  53. font-size: 12px;
  54. font-weight: bold;
  55. border-bottom: 1px solid #fff;
  56. .name {
  57. width: 15%;
  58. text-align: center;
  59. }
  60. .title {
  61. text-align: center;
  62. width: 55%;
  63. word-wrap: break-word;
  64. word-break: break-all;
  65. // overflow: hidden;/*这个参数根据需求来决定要不要*/
  66. }
  67. .data {
  68. text-align: center;
  69. width: 30%;
  70. }
  71. }
  72. }
  73. }
  74. </style>