You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
849 B

  1. <template>
  2. <v-data-table
  3. :headers="headers"
  4. :items="metaArray"
  5. item-key="key"
  6. hide-default-footer
  7. disable-pagination
  8. class="elevation-1"
  9. />
  10. </template>
  11. <script>
  12. export default {
  13. props: {
  14. metadata: {
  15. type: Object,
  16. default: () => ({}),
  17. required: true
  18. }
  19. },
  20. data() {
  21. return {
  22. headers: [
  23. {
  24. text: 'Key',
  25. align: 'left',
  26. value: 'key',
  27. sortable: false
  28. },
  29. {
  30. text: 'Value',
  31. align: 'left',
  32. value: 'value',
  33. sortable: false
  34. }
  35. ]
  36. }
  37. },
  38. computed: {
  39. metaArray() {
  40. const items = []
  41. for (const [key, value] of Object.entries(this.metadata)) {
  42. items.push({
  43. key,
  44. value
  45. })
  46. }
  47. return items
  48. }
  49. }
  50. }
  51. </script>