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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cardtabs

v0.1.4

Published

卡片切换 - 展示类组件

Downloads

8

Readme

card-tabs

一个基于vue的可视化tabs切换组件,可用于图片/照片展示,可视化业务处理,系统门户等。效果完全基于CSS3动画,扩展性高

github地址:https://github.com/yeheihei/card-tabs

示例

  1. 作为图片预览

  1. 自定义业务

安装

npm install cardtabs

注册

// 全局注册
import cardTabs from 'cardtabs'
Vue.use(cardTabs)

// 局部注册
import {cardTabs} from 'cardtabs'
components: {
  cardTabs
}

使用

示例代码
<template>
    <div id="app">
        <cardTabs ref="cardTabs" :cards="cards">
          <div slot="customSlot">
            自定义内容
          </div>
        </cardTabs>
    </div>
</template>

<script>
import { cardTabs } from 'cardtabs';

export default {
    name: 'App',
    data() {
        return {
            cards: [
                {
                    url: 'https://cdn.jsdelivr.net/gh/yeheihei/picture/2020-10-19/1603107123273-wallhaven-xlq1rv.jpg',
                },
                {
                    url: 'https://cdn.jsdelivr.net/gh/yeheihei/picture/2020-10-19/1603107123295-backiee-98927.jpg',
                },
                {
                    url: 'https://cdn.jsdelivr.net/gh/yeheihei/picture/2020-10-19/1603107123209-backiee-102533.jpg',
                },
                {
                  slotName: 'customSlot'
                }
            ],
        };
    },
    components: {
        cardTabs,
    },
    methods: {},
    mounted() {
        this.$refs.cardTabs.setIndex(1);
    },
};
</script>

参数:

| 参数名 | 类型 | 是否必填 | 默认值 | 说明 | | -------- | ------- | -------- | ------ | --------------------------- | | cards | Array | 是 | [] | 对象数组,控制组件展示 | | height | Number | 否 | 500 | 组件高度,非实际高度(bug) | | showIcon | Boolean | 否 | true | 左右切换按钮是否默认显示 |

cards: | 参数名 | 类型 | 是否必填 | 默认值 | 说明 | | --- | --- | --- | --- | --- | | slotName | String | 否 | null | 自定义内容的自定义插槽名,和 url 同时有且只能有一个 | | url | Streing | 否 | null | 作为图片展示是的预览 url |

插槽: | 插槽名 | 说明 | | --- | --- | | leftIcon | 自定义左侧切换按钮 | | rightIcon | 自定义右侧切换按钮 | | 自定义插槽名 | 根据 cards 数据配置的 slotName 来确定 |

方法: | 方法名 | 参数 | 返回值 | 说明 | | --- | --- | --- | --- | | leftTog | 无 | 无 | 左切换 | | rightTog | 无 | 无 | 右切换 | | setIndex | index | 无 | 切换到第几个索引 |

本项目启动

// 安装依赖
npm install

// 启动
npm run serve

// 文档打包
npm run build

// cardtabs 打包
npm run lib