Skip to content

Commit 661885f

Browse files
LittleSoundclaude
andauthored
feat(widgets): lazy load images in FormDropdown (#5904)
some users may have a very large number of files, so we only need to request/render the ones that are visible. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5904-feat-widgets-lazy-load-images-in-FormDropdown-2816d73d36508195b283ff469061f3f3) by [Unito](https://www.unito.io) Co-authored-by: Claude <[email protected]>
1 parent 5cff131 commit 661885f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/renderer/extensions/vueNodes/widgets/components/form/dropdown/FormDropdownMenuItem.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import { computed, inject, ref } from 'vue'
33
4+
import LazyImage from '@/components/common/LazyImage.vue'
45
import { cn } from '@/utils/tailwindUtil'
56
67
import { AssetKindKey, type LayoutMode } from './types'
@@ -102,10 +103,11 @@ function handleVideoLoad(event: Event) {
102103
muted
103104
@loadeddata="handleVideoLoad"
104105
/>
105-
<img
106+
<LazyImage
106107
v-else-if="mediaSrc"
107108
:src="mediaSrc"
108-
class="size-full object-cover"
109+
:alt="name"
110+
image-class="size-full object-cover"
109111
@load="handleImageLoad"
110112
/>
111113
<div

0 commit comments

Comments
 (0)