feat: remove props destructuring from KanbanCard
This commit is contained in:
parent
07130bdc3a
commit
ddc18aa177
@ -114,19 +114,18 @@ import AssigneeList from '@/components/tasks/partials/AssigneeList.vue'
|
|||||||
import {playPopSound} from '@/helpers/playPop'
|
import {playPopSound} from '@/helpers/playPop'
|
||||||
import {isEditorContentEmpty} from '@/helpers/editorContentEmpty'
|
import {isEditorContentEmpty} from '@/helpers/editorContentEmpty'
|
||||||
|
|
||||||
const {
|
const props = withDefaults(defineProps<{
|
||||||
task,
|
|
||||||
loading = false,
|
|
||||||
} = defineProps<{
|
|
||||||
task: ITask,
|
task: ITask,
|
||||||
loading: boolean,
|
loading: boolean,
|
||||||
}>()
|
}>(), {
|
||||||
|
loading: false,
|
||||||
|
})
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const loadingInternal = ref(false)
|
const loadingInternal = ref(false)
|
||||||
|
|
||||||
const color = computed(() => getHexColor(task.hexColor))
|
const color = computed(() => getHexColor(props.task.hexColor))
|
||||||
|
|
||||||
async function toggleTaskDone(task: ITask) {
|
async function toggleTaskDone(task: ITask) {
|
||||||
loadingInternal.value = true
|
loadingInternal.value = true
|
||||||
@ -147,7 +146,7 @@ async function toggleTaskDone(task: ITask) {
|
|||||||
function openTaskDetail() {
|
function openTaskDetail() {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'task.detail',
|
name: 'task.detail',
|
||||||
params: {id: task.id},
|
params: {id: props.task.id},
|
||||||
state: {backdropView: router.currentRoute.value.fullPath},
|
state: {backdropView: router.currentRoute.value.fullPath},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -155,12 +154,12 @@ function openTaskDetail() {
|
|||||||
const coverImageBlobUrl = ref<string | null>(null)
|
const coverImageBlobUrl = ref<string | null>(null)
|
||||||
|
|
||||||
async function maybeDownloadCoverImage() {
|
async function maybeDownloadCoverImage() {
|
||||||
if (!task.coverImageAttachmentId) {
|
if (!props.task.coverImageAttachmentId) {
|
||||||
coverImageBlobUrl.value = null
|
coverImageBlobUrl.value = null
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const attachment = task.attachments.find(a => a.id === task.coverImageAttachmentId)
|
const attachment = props.task.attachments.find(a => a.id === props.task.coverImageAttachmentId)
|
||||||
if (!attachment || !SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.toLowerCase().endsWith(suffix))) {
|
if (!attachment || !SUPPORTED_IMAGE_SUFFIX.some((suffix) => attachment.file.name.toLowerCase().endsWith(suffix))) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -170,7 +169,7 @@ async function maybeDownloadCoverImage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => task.coverImageAttachmentId,
|
() => props.task.coverImageAttachmentId,
|
||||||
maybeDownloadCoverImage,
|
maybeDownloadCoverImage,
|
||||||
{immediate: true},
|
{immediate: true},
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user