Commit 37546bd0 authored by Dazzle Wu's avatar Dazzle Wu

fix: 最近创作封面图比例

parent 4eaad353
...@@ -14,6 +14,8 @@ interface CreationTemplateInfoItem { ...@@ -14,6 +14,8 @@ interface CreationTemplateInfoItem {
modifiedTime: string modifiedTime: string
draftName: string draftName: string
pageLayout: ScreenType pageLayout: ScreenType
width: number
height: number
} }
const router = useRouter() const router = useRouter()
...@@ -45,6 +47,8 @@ function getRecentCreationList() { ...@@ -45,6 +47,8 @@ function getRecentCreationList() {
coverUrl: item.coverUrl, coverUrl: item.coverUrl,
taskType: item.taskType, taskType: item.taskType,
pageLayout: item.pageLayout, pageLayout: item.pageLayout,
width: item.width,
height: item.height,
})) }))
fetchCreationTemplateInfoListLoading.value = false fetchCreationTemplateInfoListLoading.value = false
...@@ -103,7 +107,10 @@ function handleToCreation(draftId: number) { ...@@ -103,7 +107,10 @@ function handleToCreation(draftId: number) {
<img <img
class="z-1 relative object-cover transition-[scale] duration-300 ease-in-out hover:scale-110" class="z-1 relative object-cover transition-[scale] duration-300 ease-in-out hover:scale-110"
:class=" :class="
templateInfoItem.pageLayout === ScreenType.LANDSCAPE ? 'aspect-[16/9]' : 'aspect-[9/16] h-full' templateInfoItem.pageLayout === ScreenType.LANDSCAPE ||
templateInfoItem.width > templateInfoItem.height
? 'aspect-[16/9]'
: 'aspect-[9/16] h-full'
" "
:src="templateInfoItem.coverUrl" :src="templateInfoItem.coverUrl"
alt="cover" alt="cover"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment