refactor: remove withDefaults
macro and clean up reactive props destructuring (#3217)
This commit is contained in:
parent
7d9712c209
commit
60b1d0224c
52 changed files with 177 additions and 232 deletions
|
@ -1,14 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
const { attachment, removable = true } = defineProps<{
|
||||
attachment: mastodon.v1.MediaAttachment
|
||||
alt?: string
|
||||
removable?: boolean
|
||||
dialogLabelledBy?: string
|
||||
}>(), {
|
||||
removable: true,
|
||||
})
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(evt: 'remove'): void
|
||||
|
@ -19,7 +17,7 @@ const emit = defineEmits<{
|
|||
const maxDescriptionLength = 1500
|
||||
|
||||
const isEditDialogOpen = ref(false)
|
||||
const description = ref(props.attachment.description ?? '')
|
||||
const description = ref(attachment.description ?? '')
|
||||
|
||||
function toggleApply() {
|
||||
isEditDialogOpen.value = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue