perf: optimization phases 3-5
This commit is contained in:
@ -200,6 +200,7 @@ function resetFilters() {
|
||||
<div
|
||||
v-for="biz in filteredBusinesses"
|
||||
:key="biz.id"
|
||||
v-memo="[biz.id]"
|
||||
class="biz-card"
|
||||
@click="handleExplore(biz)"
|
||||
>
|
||||
@ -207,6 +208,8 @@ function resetFilters() {
|
||||
<img
|
||||
:src="getImageUrl(biz.image_url, 'business')"
|
||||
:alt="biz.name"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
class="biz-img"
|
||||
@error="(e) => (e.target as HTMLImageElement).src = getImageUrl(null, 'business')"
|
||||
/>
|
||||
@ -271,12 +274,15 @@ function resetFilters() {
|
||||
<div
|
||||
v-for="biz in featuredBusinesses"
|
||||
:key="biz.id"
|
||||
v-memo="[biz.id]"
|
||||
class="featured-card"
|
||||
@click="handleExplore(biz)"
|
||||
>
|
||||
<img
|
||||
:src="getImageUrl(biz.image_url, 'business')"
|
||||
:alt="biz.name"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
class="featured-img"
|
||||
@error="(e) => (e.target as HTMLImageElement).src = getImageUrl(null, 'business')"
|
||||
/>
|
||||
@ -306,6 +312,7 @@ function resetFilters() {
|
||||
<div
|
||||
v-for="biz in gridBusinesses"
|
||||
:key="biz.id"
|
||||
v-memo="[biz.id]"
|
||||
class="biz-card"
|
||||
@click="handleExplore(biz)"
|
||||
>
|
||||
@ -313,6 +320,8 @@ function resetFilters() {
|
||||
<img
|
||||
:src="getImageUrl(biz.image_url, 'business')"
|
||||
:alt="biz.name"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
class="biz-img"
|
||||
@error="(e) => (e.target as HTMLImageElement).src = getImageUrl(null, 'business')"
|
||||
/>
|
||||
|
||||
@ -174,6 +174,7 @@ const getStatusClass = (status: string) => {
|
||||
<div
|
||||
v-for="route in routeStore.allRoutes"
|
||||
:key="route.id"
|
||||
v-memo="[route.id]"
|
||||
class="bg-slate-50 dark:bg-card-dark p-5 rounded-[2rem] shadow-sm border border-slate-200 dark:border-white/5 flex flex-col gap-4 active:scale-[0.98] transition-all cursor-pointer"
|
||||
@click="goToSchedules(route)"
|
||||
>
|
||||
@ -219,12 +220,13 @@ const getStatusClass = (status: string) => {
|
||||
<div
|
||||
v-for="taxi in taxiStore.taxis"
|
||||
:key="taxi.id"
|
||||
v-memo="[taxi.id]"
|
||||
class="bg-slate-50 dark:bg-card-dark p-5 rounded-[2rem] shadow-sm border border-slate-200 dark:border-white/5 flex flex-col gap-4 active:scale-[0.98] transition-all"
|
||||
>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="size-14 rounded-2xl bg-primary/10 flex items-center justify-center text-primary overflow-hidden">
|
||||
<img v-if="taxi.image_url" :src="taxi.image_url" class="w-full h-full object-cover">
|
||||
<img v-if="taxi.image_url" :src="taxi.image_url" loading="lazy" decoding="async" class="w-full h-full object-cover">
|
||||
<span v-else class="material-icons text-[32px]">local_taxi</span>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@ -187,11 +187,13 @@ function getShiftLabel(shift: string) {
|
||||
</div>
|
||||
|
||||
<div v-else class="taxis-grid">
|
||||
<div v-for="taxi in filteredTaxis" :key="taxi.id" class="taxi-card-new">
|
||||
<div v-for="taxi in filteredTaxis" :key="taxi.id" v-memo="[taxi.id]" class="taxi-card-new">
|
||||
<div class="card-top">
|
||||
<div class="driver-avatar">
|
||||
<img
|
||||
:src="getImageUrl(taxi.image_url, 'taxi')"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
alt="Driver"
|
||||
@error="(e) => (e.target as HTMLImageElement).src = getImageUrl(null, 'taxi')"
|
||||
>
|
||||
@ -284,6 +286,7 @@ function getShiftLabel(shift: string) {
|
||||
<div
|
||||
v-for="shuttle in filteredShuttles"
|
||||
:key="shuttle.id"
|
||||
v-memo="[shuttle.id]"
|
||||
:ref="el => setShuttleRef(el, shuttle.id)"
|
||||
class="shuttle-card"
|
||||
:class="{ expanded: expandedShuttleId === shuttle.id }"
|
||||
@ -296,6 +299,8 @@ function getShiftLabel(shift: string) {
|
||||
>
|
||||
<img
|
||||
:src="getImageUrl(shuttle.image_url, 'shuttle')"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
class="shuttle-card-bg"
|
||||
@error="(e) => (e.target as HTMLImageElement).src = getImageUrl(null, 'shuttle')"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user