Skip to content

Commit

Permalink
refactor: use defineModel
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Oct 23, 2024
1 parent e34b9a8 commit 3d4dda6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/components/Document/DocumentCard/DocumentCardGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
})
Expand All @@ -65,14 +62,13 @@ const to = computed(() => {
<document-thumbnail :document="document" size="md" crop clickable :active="hover" class="mx-auto" />
</router-link>
<document-actions-group
v-model:selected="selected"
:document="document"
:is-download-allowed="isDownloadAllowed"
:selected="selected"
:select-mode="selectMode"
name="checkbox"
tooltip-placement="right"
vertical
@update:selected="$emit('update:selected', $event)"
/>
</div>
<div class="document-card-grid__properties">
Expand Down

0 comments on commit 3d4dda6

Please sign in to comment.