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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ophiuchus/skeleton

v1.0.1

Published

### 介绍

Downloads

2

Readme

Skeleton 骨架屏

介绍

用于在内容加载过程中展示一组占位图形。

引入

import Vue from 'vue';
import Skeleton from '@ophiuchus/skeleton';

Vue.use(Skeleton);

代码演示

基础用法

通过 title 属性显示标题占位图,通过 row 属性配置占位段落行数。

<sf-skeleton title :row="3" />

显示头像

通过 avatar 属性显示头像占位图。

<sf-skeleton title avatar :row="3" />

展示子组件

loading 属性设置成 false 表示内容加载完成,此时会隐藏占位图,并显示 Skeleton 的子组件。

<sf-skeleton title avatar :row="3" :loading="loading">
  <div>实际内容</div>
</sf-skeleton>
export default {
  data() {
    return {
      loading: true,
    };
  },
  mounted() {
    this.loading = false;
  },
};

API

Props

| 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | row | 段落占位图行数 | number | string | 0 | | row-width | 段落占位图宽度,可传数组来设置每一行的宽度 | number | string |(number | string)[] | 100% | | title | 是否显示标题占位图 | boolean | false | | avatar | 是否显示头像占位图 | boolean | false | | loading | 是否显示骨架屏,传 false 时会展示子组件内容 | boolean | true | | animate | 是否开启动画 | boolean | true | | round | 是否将标题和段落显示为圆角风格 | boolean | false | | title-width | 标题占位图宽度 | number | string | 40% | | avatar-size | 头像占位图大小 | number | string | 32px | | avatar-shape | 头像占位图形状,可选值为square | string | round |

样式变量

组件提供了下列 Less 变量,可用于自定义样式,使用方法请参考主题定制

| 名称 | 默认值 | 描述 | | --------------------------------- | --------------- | ---- | | @skeleton-row-height | 16px | - | | @skeleton-row-background-color | @active-color | - | | @skeleton-row-margin-top | @padding-sm | - | | @skeleton-title-width | 40% | - | | @skeleton-avatar-size | 32px | - | | @skeleton-avatar-background-color | @active-color | - | | @skeleton-animation-duration | 1.2s | - |