mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
feat(front): add ImageCompressResult component to ResultIndexView for handling image compression results
This commit is contained in:
@@ -19,21 +19,24 @@ const handleList = [
|
||||
{ component: FileShareResult, key: 'file-share' },
|
||||
{ component: TextShareResult, key: 'text-share' },
|
||||
]
|
||||
const handleComponent = computed(() => {
|
||||
return handleList.find((item) => item.key === props?.data?.handle_type)?.component
|
||||
|
||||
const activeHandle = computed(() => {
|
||||
return handleList.find((item) => item.key === props?.data?.handle_type)
|
||||
})
|
||||
// vue这个ts蠢的没边了,本来想写component: FileShareResult | TextShareResult,结果不行
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<FileShareResult
|
||||
v-if="handleComponent === FileShareResult && 'file' in data"
|
||||
<component
|
||||
v-if="'file' in data"
|
||||
:is="activeHandle?.component"
|
||||
:data="data"
|
||||
@change="(key: string) => emit('change', key)"
|
||||
/>
|
||||
<TextShareResult
|
||||
v-else-if="handleComponent === TextShareResult && 'text' in data"
|
||||
<component
|
||||
v-if="'text' in data"
|
||||
:is="activeHandle?.component"
|
||||
:data="data"
|
||||
@change="(key: string) => emit('change', key)"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user