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

slider-v

v1.1.3

Published

slider-v in vue.js

Downloads

4

Readme

slider

slider基于vue开发的轮播图组件

  • pc端可使用
  • 移动端touch可使用
  • 组件自行判断终端设备,移动端时会自适应,开启touch事件
  • 窗口变化时,组件自行重新渲染,适应新的屏幕尺寸
  • 组件由外部父级盒子决定自身宽高

安装

npm install slider-v --sava

使用

import slider from 'slider-v'

components:{
 slider
}
<slider>
 <div v-for="item in bannerList">
  <img :src="item.src">
 </div>
</slider>
<!--或者可以-->
<slider>
 <div v-for="item in bannerList">
  <a :href='item.href'>
   <img :src="item.src">
  </a>
 </div>
</slider>

参数

<slider :sliderList='sliderList' :autoplay='true' :sliderType="'slide'">
 <!--所有参数按此逻辑填写-->		
</slider>

sliderList

 必填数据

接受数组形式数据,此为唯一必填参数, 该参数是为了在数据改变时, 能重新渲染组件<br>
轮播数据, 数组, 默认为空数组

autoplay

是否自动播放滚动, 布尔值, 默认true(自动播放)

time

切换轮播时间, 数字, 默认3000(ms)

sliderType

轮播方式, 字符串, 默认为'slide'
  • 'slide' 左右滑动
  • 'fade' 淡入淡出
  • '3d' 3d形式轮播(非真3d) 3d方式中,中央显示图片的宽度为最外围盒子的一半

arrowsShow

是否显示左右箭头, 布尔值, 默认true(显示)

dotsShow

是否显示导航点, 布尔值, 默认true(显示)

hoverStop

是否在鼠标移入时,停止轮播图滚动(在开启自动轮播时有效) 布尔值, 默认true(不停止)<br>
// 在轮播图沾满全屏时,鼠标始终会在轮播图内,此时可开启

回调

<slider @currentIndex='current'>
	<!--所有回调按此逻辑填写,current为你定义的回调函数名-->
</slider>
methods: {
	current(index) {
		console.log(index)
		// index为回调值
	}
}

currentIndex

返回当前轮播位置的索引值, 索引值以0开始