Skip to content

Commit ca3fd12

Browse files
committed
feat: add lazy loading to item images for improved performance
1 parent f5f7177 commit ca3fd12

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

POS/src/components/sale/BatchSerialDialog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
v-if="item.image"
1414
:src="item.image"
1515
:alt="item.item_name"
16+
loading="lazy"
1617
class="w-full h-full object-cover"
1718
/>
1819
<svg v-else class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">

POS/src/components/sale/InvoiceCart.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
v-if="item.image"
160160
:src="item.image"
161161
:alt="item.item_name"
162+
loading="lazy"
162163
class="w-full h-full object-cover"
163164
/>
164165
<svg

POS/src/components/sale/ItemSelectionDialog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div v-if="item" class="mb-4">
66
<div class="flex items-center space-x-3 mb-3">
77
<div class="w-12 h-12 bg-gray-100 rounded flex items-center justify-center overflow-hidden flex-shrink-0">
8-
<img v-if="item.image" :src="item.image" :alt="item.item_name" class="w-full h-full object-cover" />
8+
<img v-if="item.image" :src="item.image" loading="lazy" :alt="item.item_name" class="w-full h-full object-cover" />
99
<svg v-else class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1010
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"/>
1111
</svg>
@@ -28,7 +28,7 @@
2828
<div v-else-if="mode === 'variant' && options.length > 0" class="space-y-4">
2929
<!-- Display item image and info -->
3030
<div class="flex items-center justify-center mb-4">
31-
<img v-if="item?.image" :src="item.image" :alt="item.item_name" class="w-32 h-32 object-contain rounded-lg" />
31+
<img v-if="item?.image" :src="item.image" loading="lazy" :alt="item.item_name" class="w-32 h-32 object-contain rounded-lg" />
3232
</div>
3333

3434
<!-- Group variants by attributes -->

0 commit comments

Comments
 (0)