From 3d4dda6e65d6e0114b84a8f68b68ecc8d1b9e4b9 Mon Sep 17 00:00:00 2001 From: Pierre Romera Date: Wed, 23 Oct 2024 17:45:12 +0000 Subject: [PATCH] refactor: use defineModel --- .../Document/DocumentCard/DocumentCardGrid.vue | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/Document/DocumentCard/DocumentCardGrid.vue b/src/components/Document/DocumentCard/DocumentCardGrid.vue index 05e6c29b49..265405db1d 100644 --- a/src/components/Document/DocumentCard/DocumentCardGrid.vue +++ b/src/components/Document/DocumentCard/DocumentCardGrid.vue @@ -6,6 +6,8 @@ import DocumentCardProperties from './DocumentCardProperties' import DocumentThumbnail from '@/components/Document/DocumentThumbnail' import DocumentActionsGroup from '@/components/Document/DocumentActionsGroup/DocumentActionsGroup' +const selected = defineModel('selected', { type: Boolean }) + const props = defineProps({ document: { type: Object @@ -24,23 +26,18 @@ const props = defineProps({ selectMode: { type: Boolean }, - selected: { - type: Boolean - }, isDownloadAllowed: { type: Boolean } }) -const emit = defineEmits(['preview', 'update:selected']) - const hover = ref(false) const classList = computed(() => { return { 'document-card-grid--active': props.active, 'document-card-grid--select-mode': props.selectMode, - 'document-card-grid--selected': props.selected, + 'document-card-grid--selected': selected.value, 'document-card-grid--hover': hover.value } }) @@ -65,14 +62,13 @@ const to = computed(() => {