index.vue 868 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <view class="item-list-container">
  3. <template v-for="(item, index) in ds">
  4. <view class="list-item" :key="index" @click="onItemClick(item)">
  5. <view class="list-item-left">
  6. <image class="list-item-img" :src="item.imgUrl"></image>
  7. </view>
  8. <view class="list-item-right">
  9. <view class="item-title">{{ item.title }}</view>
  10. <view class="item-content">{{ item.date }}</view>
  11. </view>
  12. </view>
  13. </template>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'item-list',
  19. props: {
  20. ds: {
  21. type: Array,
  22. default: () => [],
  23. },
  24. onItemClick: {
  25. type: Function,
  26. default: () => {},
  27. },
  28. },
  29. data() {
  30. return {};
  31. },
  32. created() {
  33. this.children = [];
  34. },
  35. onLoad() {
  36. },
  37. methods: {},
  38. };
  39. </script>
  40. <style lang="scss" src="./index.scss" />