Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to render data? #7

Open
phucvo0709 opened this issue May 1, 2018 · 3 comments
Open

How to render data? #7

phucvo0709 opened this issue May 1, 2018 · 3 comments

Comments

@phucvo0709
Copy link

I used many ways but could not render my data after loading, hope to get help!

@michalsnik
Copy link
Owner

Hi, I'm not sure I get your question, but you should use v-if/v-else directive and show content placeholders only while loading, otherwise display your items as you normally would.

@imlinus
Copy link

imlinus commented Nov 21, 2018

Sorry for old answer, but I'm hoping someone else might find it useful.

<div v-if="isLoading">
  <content-placeholders :rounded="true" :centered="true">
    <content-placeholders-text :lines="8" />
  </content-placeholders>
</div>

<div v-else>

</div>

@Criminal-sudo
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants