79214435

Date: 2024-11-22 09:54:35
Score: 0.5
Natty:
Report link

I found solution, it seems to work.

<LazyModalsCategories v-if="isShowCategoriesModal || isModalOpened" />

<LazyModalsAuth v-if="isShowAuthModal || isModalOpened" />

<LazyModalsSettings v-if="isShowSettingsModal || isModalOpened" />

For every my lazy-modal component I added one more condition to "v-if" block. All needed modals I mathed with this "isModalOpened" variable.

const isModalOpened = ref(false);

And after this, in onMounted I switch it

onMounted(async () => {
  // some my code

  isModalOpened.value = true;

  nextTick(() => {
    isModalOpened.value = false;
  })
});

We won't see any changes on the page, we won't see this modal "tick-opening", but now first time modal (hand) opening should be momental

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Tim Miller