S
S
salco20122021-11-29 23:27:41
JavaScript
salco2012, 2021-11-29 23:27:41

Need to make v-loading work before hooks?

I use loaderlibraries element-io. The problem is this: when I enter my personal account, I need it to spin loaderuntil the personal account is completely rendered, i.e. another component to which router.push is thrown B data> state> isLoadingis set to true; But, now when entering, it loaderstarts spinning after 1 second, and this is logical, it works on the mounted hook when the tree is mounted, because my loader is in dive; Question: tell me how to implement the logic I conceived, that is, to loadingspin until the component on which I push is completely rendered? Thank you in advance for your help!)

<template>
    <div
    v-loading.fullscreen="isLoading"
    element-loading-text="Загрузка..."
    element-loading-background="rgba(0, 0, 0, 0.8)"
  >
   ...множество другого кода, который не относится к теме, удалил чтоб не засорять
</div>
</template>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iBird Rose, 2021-11-29
@salco2012

according to the normal loader, you need to insert it into App.vue, or if you don’t want it, then into the root element of the section you need. Well, connect it as a plugin so that you can reach its methods.
You can see how other similar loader plugins are implemented. They are full

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question