LucasLeandro1204 / vue-content-loading

Vue component to easily build (or use presets) SVG loading cards Facebook like.
https://lucasleandro1204.github.io/vue-content-loading/
MIT License
758 stars 75 forks source link

Skeleton screen loading management #33

Open Criminal-sudo opened 4 years ago

Criminal-sudo commented 4 years ago

I was also writing a Skeleton screen and encountered a problem. After reading your code, my confusion is even greater. The skeleton screen needs a loading boolean value to determine whether to render. There will be many pages in a project, and a loading boolean needs to be bound to each page. This is a repeated declaration of loading. boolean. There is another situation: there will be many AJax requests on a page, and each request will be a separate module on the page, and a separate module is a skeletal screen, which will cause more repeated work of declaring laoding boolean Therefore, all AJax requests for the page are placed in Promise.all. After all requests are successful, the page is displayed normally, otherwise the skeleton screen is displayed. This is my doubt now, I don't want to repeatedly declare the loading boolean, so I don't know if you have a better solution