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

vue-skeleton-mini

v0.3.0

Published

## Install ``` npm i vue-skeleton-mini --save ```

Downloads

4

Readme

vue-skeleton-mini

Install

npm i vue-skeleton-mini --save

Use

import Vue from 'vue'
import App from './App.vue'
import Skeleton from 'vue-skeleton-mini'
import 'vue-skeleton-mini/lib/skeleton.css'

Vue.use(Skeleton)
Vue.config.productionTip = false

new Vue({
  render: h => h(App),
}).$mount('#app')

Demo

https://wykun1120.github.io/vue-skeleton-mini/

Config

| 参数 | 功能 | 类型 | 可选值 | 默认值 | | ---- | ---- | ---- | ---- | ---- | | data | 监听的数据 | any | - | null | | defaultRender | 默认样式 | boolean | - | true | | animate | 动画 | boolean | - | false | | animateName | 内置骨架 | string | table, line | '' | | all | 多数据同时监听 | boolean | - | false | | timeOut | 超时 | number | - | 0 |

Example

<!-- 默认 -->
<skeleton :data="list">
  <div class="list-item" v-for="(item, index) in list" :key="index">{{item}}</div>
</skeleton>

<!-- 动画 -->
<skeleton :data="formData" animate>
  <div>{{formData.username}}</div>
</skeleton>

<!-- 自定义 -->
<skeleton :data="formData" :defaultLoading="false">
  <template v-slot:custom>
    <div>Skeleton</div>
  </template>
  <div>{{formData.username}}</div>
</skeleton>

<!-- 多数据同时满足 -->
<div class="container">
  <skeleton :data="[list, formData]" all animateName="line">
    <div class="list-item" v-for="(item, index) in list" :key="index">{{item}}</div>
  </skeleton>
</div>

Tips

  1. 如果异步数据获取后骨架屏未从页面去除正确显示其数据内容,data所传递的数据未被真实修改
<skeleton :data="list">
  <div class="list-item" v-for="(item, index) in list" :key="index">{{item}}</div>
</skeleton>

data() {
  return {
    list: [],
    formData: {}
  }
}

mounted() {
  setTimeout(() => {
    // 使用扩展运算符修改数据
    this.list = [...this.list]
    this.formData = {...this.formData}
  }, 2000);
}
  1. 多数据监听时需要:data=[param1, param2]all相配合

License

MIT