npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-skeleton-component

v1.1.2

Published

vue通用的骨架屏展示解决方案

Readme

这是一款通用的vue骨架屏插件

使用方法

npm install vue-skeleton-component --save-dev

// main.js
import skeleton from 'vue-skeleton-component'
Vue.use(skeleton)

骨架屏样式

初期版本只提供几个简单的样式可以选择,后续会慢慢补充

1. 分割线

以给定的容器大小为基准画一条线 image.png

<skeleton active type='straightLine' :options="{
    height: '20px',
    position: 'center'
}" />

API | 内容 | 类型 | 值 --- | --- | --- | --- type | 显示类型 | String | 组件类型 active | 是否显示动效 | Boolean | true/false options | 设置项 | Object | null width | 线的长度 | String | 100% height | 线的宽度 | String | 100% position | 线的位置 | String | ['top', 'center', 'end']

2. 圆

画一个圆 image.png

<skeleton  type='circlecom' active :options="{
    width: '150px'
}" />

API | 内容 | 类型 | 值 --- | --- | --- | --- type | 显示类型 | String | 组件类型 active | 是否显示动效 | Boolean | true/false options | 设置项 | Object | null width | 圆的直径 | String | 100%,如果不传,将会自动使用100%

3. 卡片

画一个方块 image.png

<skeleton type='card' active :options="{
    width: '200px',
    height: '150px'
}" />

API | 内容 | 类型 | 值 --- | --- | --- | --- type | 显示类型 | String | 组件类型 active | 是否显示动效 | Boolean | true/false options | 设置项 | Object | null width | 线的长度 | String | 100% height | 线的宽度 | String | 100%

4. 列表

创建一个文字行效果 image.png

<skeleton type='listcom' active :options="{
    row: 3,
    lineHight: 20
}" />

API | 内容 | 类型 | 值 --- | --- | --- | --- type | 显示类型 | String | 组件类型 active | 是否显示动效 | Boolean | true/false options | 设置项 | Object | null row | 列表行数 | Number | 3 lineHight | 行间距 | Number | 20

5. 混合类型

混合类型可以使用以上几种类型的全部api,将其整合到一起,相互拼接 image.png

混合类型使用了九宫格布局来作为基础布局,将你想插入的组件按照[a ~ i]的顺序进行排列,你可以选择你想让那些组件出现在哪一个位置,简单配置,既可以达到想要的效果 image.png

<skeleton type="custom" :options="{ width: '100%', height: '100%' }" :childrenOption="[
    {type: 'circlecom', rules: 'a, d', active: true, options:{width: '150px'} },
    {type: 'listcom', rules: 'b, c, e, f', active: true},
    {type: 'straightLine', active: true, rules: 'g, h, i'},
]" />

API | 内容 | 类型 | 值 --- | --- | --- | --- type | 显示类型 | String | 组件类型 active | 是否显示动效 | Boolean | true/false options | 设置项 | Object | null rules | 出现规则,这里不可以跨行切必须相邻 | String | 'a, b, ... i' childrenOption | 设置子组件类型 | Array[Object] | []