vue-content-placeholders icon indicating copy to clipboard operation
vue-content-placeholders copied to clipboard

How to render data?

Open phucvo0709 opened this issue 6 years ago • 3 comments

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

phucvo0709 avatar May 01 '18 08:05 phucvo0709

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.

michalsnik avatar May 14 '18 00:05 michalsnik

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>

imlinus avatar Nov 21 '18 12:11 imlinus

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

Criminal-sudo avatar Jan 20 '20 04:01 Criminal-sudo