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

cus-carousel

v1.0.4

Published

A Carousel Vue 3 component with TypeScript and SCSS built with Vite

Readme

cus-carousel

走马灯组件,参照ElementPlus el-carousel 组件效果实现,针对想要该效果但又不想使用ElementPlus UI库的开发人员实现

安装

npm install cus-carousel
# or
yarn add cus-carousel
# or
pnpm add cus-carousel

使用

templateUse.vue

<template>
  <CusCarousel type="card" :interval="3000" height="300px" arrow="hover">
     <CusCarouselItem v-for="(img, idx) of imageList" :key="idx">
       <img :src="img" :alt="`img-${idx}`" style="width: 100%;height: 100%;">
     </CusCarouselItem>
  </CusCarousel>
</template>

<script lang="ts" setup>
import{ CusCarousel, CusCarouselItem } from 'cus-carousel'

const imageList = [
  'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
  'https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg',
  'https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg',
  'https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg',
  'https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg',
  'https://fuss10.elemecdn.com/3/28/bbf893f792f03a54408b3b7a7ebf0jpeg.jpeg',
  'https://fuss10.elemecdn.com/2/11/6535bcfb26e4c79b48ddde44f4b6fjpeg.jpeg',
]
</script>

组件Carousel Props配置

| 属性名 | 说明 | 类型 | 默认值 | | -------------------- | ------------------------------------- | -------------------------------------------- | ------------ | | height | carousel 的高度 | string | '300px' | | initialIndex | 初始状态激活的幻灯片的索引,从 0 开始 | number | 0 | | trigger | 指示器的触发方式 | 'click'|'hover' | 'hover' | | autoplay | 是否自动切换 | boolean | true | | interval | 自动切换的时间间隔,单位为毫秒 | number | 3000 | | indicatorPosition | 指示器的内外位置 | '' | 'outside' | 'none' | '' | | indicatorPlace | 指示器的排放位置 | ''|'left'|'right'|'top'|'bottom'|'none' | '' | | indicatorNormalColor | 默认指示器的颜色 | string | '#c0c4cc' | | indicatorActiveColor | 当前激活的默认指示器的颜色 | string | '#409eff' | | arrow | 切换箭头的显示时机 | 'always' | 'never' | 'hover' | 'hover' | | type | carousel 的类型 | '' | 'card' | '' | | cardScale | 当 type 为 card 时,二级卡的缩放大小 | number | 0.83 | | loop | 是否循环显示 | boolean | true | | direction | 展示的方向 | 'horizontal' | 'vertical' | 'horizontal' | | pauseOnHover | 鼠标悬浮时暂停自动切换 | boolean | true |

组件Carousel slot

| slot | 说明 | | ------------------------------------------------------------ | ------------------ | | <slot name="arrows" :arrowDisplay="arrowDisplay" :isHovering="isHovering" :prev="prev" :next="next"></slot> | 自定义左右切换按钮 | | <slot></slot> | 默认插槽 | | <slot name="indicators" :items="items" :activeIndex="activeIndex" :setActiveItem="setActiveItem"></slot> | 自定义指示器插槽 |

组件Carousel Event

| 事件名 | 说明 | 类型 | | ---------- | ------------------------------------------------------------ | -------- | | change | 当前展示的幻灯片切换时触发,它有两个参数, 一个是新幻灯片的索引,另一个是旧幻灯片的索引 | Function |

组件Carousel Exposes

| 名称 | 说明 | 类型 | | ------------- | ------------------------------------------------------------ | ---------- | | activeIndex | 当前幻灯片的索引 | number | | setActiveItem | 手动切换幻灯片,传入需要切换的幻灯片的索引,从 0 开始;或相应 el-carousel-itemname 属性值 | Function | | prev | 切换至上一张幻灯片 | Function | | next | 切换至下一张幻灯片 | Function |

组件CarouselItem Props配置

| 属性名 | 说明 | 类型 | 默认值 | | ------ | ------------------------------------------- | ------ | ------ | | label | 幻灯片的名字,可用作 setActiveItem 的参数 | string | '' | | name | 该幻灯片所对应指示器的文本 | string | '' |

组件CarouselItem slot

| slot | 说明 | | --------------- | -------- | | <slot></slot> | 默认内容 |

源代码

Github

Gitee