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

va-carousel

v1.0.4

Published

一个vue写的图片轮播组件

Readme

va-carousel

一个基于 vue 的图片轮播组件

体验

方式 1

在线Demo http://va-carousel.xiaoshang.online

方式 2

git clone https://github.com/zhangxiaoshang/va-carousel.git
cd va-carousel
npm install
npm start

使用

1.使用 vue-cli 构建一个项目

# 这里默认你已经安装了vue-cli
vue init webpack vue-project

2.安装 va-carousel

cd vue-project
npm install --save va-carousel

3.导入组件

在需要使用 VaCarousel 的组件中,导入组件

js 部分

<script>
import VaCarousel from 'va-carousel/src/components/VaCarousel'

export default {
  name: 'App',
  components: {
    VaCarousel
  }
}
</script>

template 部分

<template>
  <div id="app">
    <VaCarousel/>
  </div>
</template>

4.启动项目

npm run dev

Attributes

| 参数 | 说明 | 类型 | 可选值 | 默认值 | | --------- | ------------------------------------------------------------------------------ | ------- | ------------------ | ------ | | items | 数据列表, 每个元素是一个对象,其中 id、src 属性是必需要有的(不允许有重复的 id) | array | - | - | | total | 需要显示的图片数量,当数量为奇数时,中间图片会 被放大 | number | - | 7 | | height | 走马灯的高度 | string | - | 180px | | width | 走马灯的宽度 | string | - | 90% | | imgWidth | 图片宽度 | string | - | 100% | | imgHeight | 图片高度 | string | - | 70% | | autoplay | 是否自动切换 | boolean | - | true | | interval | 自动切换的时间间隔,单位为毫秒 | number | - | 2000 | | prevText | 向上箭头上显示的内容 | string | - | prev | | nextText | 向下箭头上显示的内容 | string | - | next | | arrow | 切换箭头的显示时机 | string | always/hover/never | hover |

Events

| 事件名称 | 说明 | 回调参数 | | ------------ | -------------- | ------------------------------------ | | selectedItem | 点击图片时触发 | 当前图片对象,当前图片在列表中的位置 |

Slot

| name | 说明 | | ---- | ------------------ | | prev | 向上箭头区域的内容 | | next | 向下箭头区域的内容 |