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

lg-swiper

v1.0.0

Published

多图轮播组件

Downloads

3

Readme

多图轮播组件

一屏可显示多个内容物,一次移动一个内容物

安装

npm i --save lg-swiper

如何使用

使用举例

template:
<swiper ref="swiper" :autoplay="false" @change="swiperChange">
  <div v-for="i in 7" :key="i" class="item">
    <div class="content">{{ i }}</div>
  </div>
</swiper>

script:
import swiper from 'lg-swiper'

methods: {
  swiperChange(newIndex, oldIndex) {
    console.log("swiperChange", newIndex, oldIndex);
  }
}

参数

|参数|类型|描述|默认值| |:----- |:------|:------|:------| |show-num |Number |一屏显示的内容物个数 |3 | |initial-ndex |Number |初始状态激活的内容物的索引(即最左侧内容物对应索引) |0 | |item-width |Number |单个内容物的宽度,不传则默认为第一个内容物的宽度 |第一个内容物的宽度 | |autoplay |Boolean |是否自动切换 |true | |interval |Number |自动切换的时间间隔,单位为毫秒 |2000 | |direction |String |自动切换的方向,prev or next |next |

方法

|方法名|描述|参数| |:----- |:------|:------| |prev |切换至上一个内容物 |- | |next |切换至下一个内容物 |- | |setActiveItem |手动切换内容物 |需要切换的内容物的索引,从 0 开始 |

回调事件

|事件|描述|回调参数| |:----- |:------|:------| |change |内容物切换时触发 |目前激活的内容物的索引,原内容物的索引 |