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.

55 lines
939 B

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