vue-content-loader | SVG component to create placeholder | Animation library
kandi X-RAY | vue-content-loader Summary
kandi X-RAY | vue-content-loader Summary
SVG component to create placeholder loading, like Facebook cards loading.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vue-content-loader
vue-content-loader Key Features
vue-content-loader Examples and Code Snippets
Community Discussions
Trending Discussions on vue-content-loader
QUESTION
I'm new to VueJS, and I'm coming to you to find out if what I've done is feasible or not.
Instead of having old data, while loading components, I prefer to display a preloader. I liked the idea of a skeletons loader, rather than a simple spinner.
Right now I have a state in the store, which is null by default, I have a mutation to set the loading, and a getter. To avoid visual bugs, from the router, with a beforeEach, I initialize the loading state to true, so that by default the components start loading !
Then, in my view, I import the Loader component, with its svg and style. And I place it over the component that needs to be displayed, with a simple condition v-if="!getLoading" and v-if="getLoading".
The problem is that I feel like I'm tinkering with the blind, the beforeach and displaying this component with a condition?
I would be reassured if someone can give me some advice, or approve this method of doing!
Here is the code of a simple Loader component
...ANSWER
Answered 2020-Aug-22 at 12:10If that is a global loader being used on all the routes, you can wrap it in a component and use that component everywhere. Use named slots to manage your template. An example of a Loader component:
Loader.vue
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-content-loader
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page