diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 03c4f346d..e6e7e6fa0 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -6,6 +6,7 @@ import { useArrayData } from 'composables/useArrayData'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useState } from 'src/composables/useState'; import { useRoute } from 'vue-router'; +import { useClipboard } from 'src/composables/useClipboard'; import VnMoreOptions from './VnMoreOptions.vue'; const $props = defineProps({ @@ -42,6 +43,7 @@ const $props = defineProps({ const state = useState(); const route = useRoute(); const { t } = useI18n(); +const { copyText } = useClipboard(); const { viewSummary } = useSummaryDialog(); let arrayData; let store; @@ -99,6 +101,14 @@ function getValueFromPath(path) { return current; } +function copyIdText(id) { + copyText(id, { + component: { + copyValue: id, + }, + }); +} + const emit = defineEmits(['onFetch']); const iconModule = computed(() => route.matched[1].meta.icon); @@ -182,9 +192,22 @@ const toModule = computed(() => - + #{{ getValueFromPath(subtitle) ?? entity.id }} + + + {{ t('globals.copyId') }} + + @@ -292,3 +315,11 @@ const toModule = computed(() => } } + + en: + globals: + copyId: Copy ID + es: + globals: + copyId: Copiar ID +