v-for-iterator.vue 481 B

123456789101112131415161718192021222324
  1. <template>
  2. <recycle-list for="item in longList" switch="type">
  3. <cell-slot case="A">
  4. <div v-for="(object, index) in item.list" :key="index">
  5. <text>{{object.name}}</text>
  6. <text v-for="(v, k, i) in object" :key="k">{{v}}</text>
  7. </div>
  8. </cell-slot>
  9. </recycle-list>
  10. </template>
  11. <script>
  12. module.exports = {
  13. data () {
  14. return {
  15. longList: [
  16. { type: 'A' },
  17. { type: 'A' }
  18. ]
  19. }
  20. }
  21. }
  22. </script>