Using Nuxt layouts
in the default layout I connect modals components with Lazy
And when I try to open some modal, its first opening takes a very long time. Subsequent openings happen quickly.
When the page is reloaded, the problem persists.
I asked chatGPT, he suggested wrapping all lazy modals in . but this did not solve the problem
<template>
///
<LazyModalsProduct v-if="catalogStore.isShowProductModal" />
<LazyModalsChooseDiscount v-if="isShowChooseDiscountModal" />
<LazyModalsCart v-if="isShowCartModal" />
<LazyModalsPopup
v-if="isShowPopupModal"
/>
<LazyModalsHeaderInfoMenu
v-if="isShowMobileMenu"
/>
<LazyModalsFilters
v-if="isShowFiltersModal"
/>
<LazyModalsOrder
v-if="isShowOrderModal"
/>
///
<template>
bool vars I compute in script
<script setup>
///
const isShowAuthModal = computed(() => commonStore.isShowAuthModal);
const isShowSettingsModal = computed(() => commonStore.isShowSettingsModal);
const isShowAcceptCityModal = computed(() => commonStore.isShowAcceptCityModal);
const isShowDeliveryTypeModal = computed(() => commonStore.isShowDeliveryTypeModal);
const isShowPopupModal = computed(() => commonStore.isShowPopupModal);
///
</script>
tried to load some (1-2) modals withOut using “Lazy”, but it doesnt solve the problem
also tried , but no result
I expect the same time of opening these modals
Эрик Алоян is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.