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

pb-vue-carousel

v0.0.4

Published

vue通用轮播组件

Readme

轮播组件

基于Vue的通用轮播组件,需搭配pb-vue-carousel-item使用,目前提供淡入、平移两种切换方式

安装

npm i pb-vue-carousel
或
yarn add pb-vue-carousel

基本使用

可通过Vue.use()全局注册

import Vue from 'vue'
import PbCarousel from 'pb-vue-carousel'
import PbCarouselItem from 'pb-vue-carousel-item'

Vue.use(PbCarousel)
Vue.use(PbCarouselItem)

也可在组件中局部引用

<template>
	<div class="app">
        <pb-carousel>
    		<pb-carousel-item v-for="item in 3" :key="item">
    			<div style="background: green;color: white">
                    {{ item }}
    			</div>
    		</pb-carousel-item>
    	</pb-carousel>
    </div>
</template>

<script>
import PbCarousel from 'pb-vue-carousel'
import PbCarouselItem from 'pb-vue-carousel-item'
export default {
    components: {
        PbCarousel,
        PbCarouselItem
    }
}
</script>

自定义指示器样式

<template>
  <div id="app">
    <carousel
      type="fade"
      height="300px"
      :custom-indicator-style="{
        width: '20px',
        height: '5px',
        background: 'yellow'
      }"
      :custom-indicator-active-style="{
        width: '10px',
        height: '10px',
        borderRadius: '50%',
        background: 'red'
      }"
    >
      <carousel-item
        v-for="item in 5"
        :key="item"
      >
        <div>
          {{ item }}
        </div>
      </carousel-item>
    </carousel>
  </div>
</template>

自定义切换按钮样式

<template>
  <div id="app">
    <carousel
      type="fade"
      height="300px"
      :custom-prev-button-style="{
        imageUrl: '../arrow-left.png',
        style: {
          width: '24px',
          height: '24px'
        }
      }"
      :custom-next-button-style="{
        imageUrl: '../arrow-right.png',
        style: {
          width: '24px',
          height: '24px'
        }
      }"
    >
      <carousel-item
        v-for="item in 5"
        :key="item"
      >
        <div>
          {{ item }}
        </div>
      </carousel-item>
    </carousel>
  </div>
</template>

Attributes

| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ----------------------------- | -------------------------- | ------------------------------------------------------------ | --------- | ------ | | interval | 轮播的切换时长 | number | — | 3000 | | height | 轮播容器的高度 | string | — | 150px | | type | 轮播切换的类型 | string | fade/move | fade | | show-indicator | 是否展示指示器 | boolean | — | true | | show-switch-button | 是否展示切换按钮 | boolean | — | true | | custom-prev-button | 自定义向前切换的按钮样式 | 只接受固定属性的object{imageUrl: string, style: object} | — | — | | custom-next-button | 自定义向后切换的按钮样式 | 只接受固定属性的object{imageUrl: string, style: object} | — | — | | custom-indicator-style | 自定义指示器样式 | object | — | — | | custom-indicator-active-style | 自定义激活状态的指示器样式 | object | — | — |