![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
vue-loading-skeleton
Advanced tools
Make beautiful loading skeleton that automatically adapt your vue app.
Make beautiful loading skeleton that automatically adapt your vue app.
Install by npm
/yarn
with vue-loading-skeleton
import { Skeleton } from 'vue-loading-skeleton';
// In jsx template
<Skeleton />
<Skeleton count={5} />
Or register for global component
import Vue from 'vue';
import Skeleton from 'vue-loading-skeleton';
Vue.use(Skeleton)
// In jsx template
<PuSkeleton />
<PuSkeleton count={5} />
The <Skeleton/>
component is design to used directly in your vue component. It can replace the main content while page still in loading. So you don't need to prepare a skeleton screen meticulously to match the font-size
, margin
or another style your content takes on, wrap the content with the <Skeleton/>
component, it will automatically fill the correct dimensions.
For example:
<div class="item">
<div class="item__photo">
<PuSkeleton circle height="50px">
{{ props.data.img }}
</PuSkeleton>
</div>
<div class="item__meta">
<div class="item__title">
<PuSkeleton>{{ props.data.title }}</PuSkeleton>
</div>
<div class="item__info">
<PuSkeleton :count="2">{{ props.data.body }}</PuSkeleton>
</div>
</div>
</div>
The skeleton component will check the tag
and text
in the first child node. If you find the component work is not in expect, you should use v-if
or loading props
, and report the issues to me.
<div class="item">
<Skeleton>
{{ content }}
</Skeleton>
</div>
<div class="item">
<template v-if="content">{{ content }}</template>
<Skeleton v-else />
</div>
In many cases, you need a skeleton list to fulfill a listing page. You can set the list data default to the number. Such as:
<div class="item" v-for="(item, index) in data" :key="index">
<Skeleton>
{{ item.content }}
</Skeleton>
</div>
export default {
data() {
return {
data: 10
}
},
async created() {
// some data fetch action
const { data } = await fetchData();
this.data = data;
}
}
Using the <SkeletonTheme />
component, you can change the color, duration of all skeleton components below it:
import { Skeleton, Skeleton } form 'vue-loading-skeleton';
<SkeletonTheme color="#e6f3fd" highlight="#eef6fd">
<div class="item">
<div class="item__photo">
<PuSkeleton circle height="50px">
{{ props.data.img }}
</PuSkeleton>
</div>
<div class="item__meta">
<div class="item__title">
<PuSkeleton>{{ props.data.title }}</PuSkeleton>
</div>
<div class="item__info">
<PuSkeleton :count="2">{{ props.data.body }}</PuSkeleton>
</div>
</div>
</div>
</SkeletonTheme>
props | description | type | default |
---|---|---|---|
count | rows count of component | number | 1 |
duration | animation duration time, 0 as close | number | 1.5 |
width | component width | string | |
height | component height | string | |
circle | make the skeleton look like a circle | boolean | false |
loading | skeleton loading status | boolean | undefined |
props | description | type | default |
---|---|---|---|
color | skeleton background color | string | #eeeeee |
highlight | animation highlight color | string | #f5f5f5 |
duration | set duration of all skeleton | number | 1.5 |
loading | control loading status of all skeletons | boolean | undefined |
tag | theme container tag name | string | div |
FAQs
Make beautiful loading skeleton that automatically adapt your vue app.
The npm package vue-loading-skeleton receives a total of 2,593 weekly downloads. As such, vue-loading-skeleton popularity was classified as popular.
We found that vue-loading-skeleton demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.