drop-card.uvue 830 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <view class="root">
  3. <template v-for="(item,index) in cardList" :key="index">
  4. <card ref="card" :img="item" :cardIndex="index"></card>
  5. </template>
  6. </view>
  7. </template>
  8. <script lang="uts">
  9. import card from './card/card.uvue';
  10. export default {
  11. components: {
  12. card
  13. },
  14. data() {
  15. return {
  16. cardList: [
  17. 'https://web-ext-storage.dcloud.net.cn/hello-uni-app-x/drop-card-1.jpg',
  18. 'https://web-ext-storage.dcloud.net.cn/hello-uni-app-x/drop-card-2.jpg',
  19. 'https://web-ext-storage.dcloud.net.cn/hello-uni-app-x/drop-card-3.jpg'
  20. ] as string.ImageURIString[]
  21. }
  22. }
  23. }
  24. </script>
  25. <style>
  26. /* #ifdef MP */
  27. page {
  28. overflow: hidden
  29. }
  30. /* #endif */
  31. .root {
  32. flex: 1;
  33. position: relative;
  34. align-items: center;
  35. }
  36. </style>