logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

list.vue (813B)


  1. <template>
  2. <div
  3. class="list"
  4. role="list"
  5. >
  6. <div
  7. v-for="item in items"
  8. :key="getKey(item)"
  9. class="list-item"
  10. :class="[getClass(item), nonInteractive ? '-non-interactive' : '']"
  11. role="listitem"
  12. >
  13. <slot
  14. name="item"
  15. :item="item"
  16. />
  17. </div>
  18. <div
  19. v-if="items.length === 0 && !!$slots.empty"
  20. class="list-empty-content faint"
  21. >
  22. <slot name="empty" />
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. export default {
  28. props: {
  29. items: {
  30. type: Array,
  31. default: () => []
  32. },
  33. getKey: {
  34. type: Function,
  35. default: item => item.id
  36. },
  37. getClass: {
  38. type: Function,
  39. default: item => ''
  40. },
  41. nonInteractive: {
  42. type: Boolean,
  43. default: false
  44. }
  45. }
  46. }
  47. </script>