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

swiper-vue

v0.0.12

Published

轮播 swiper slider component for Vue.js

Downloads

31

Readme

swiper-vue,swiper

description

基于vue3.0的轮播组件,有左右和上下轮播方向。

支持左右点击箭头切换,也可以点击下方指示器切换。

支持鼠标左键点击item项后滑动切换,支持鼠标滚动切换。

具体配置、事件、插槽可看下方详细文档

在vue单组件内部引入

<template>
    <swiper-vue autoplay :delay='2000' arrow='hover' indicator :items="options">
        <template #default="{ item, index,activeIndex,isActive }">
            <div style="height: 100%;width: 100%;background: #99A9BF;display: flex;justify-content: center;align-items: center;">{{ item.name }}</div>
        </template>
    </swiper-vue>
</template>
<script lang='ts' setup>
    import 'swiper-vue/dist/hut-es.css';
    import { SwiperVue } from 'swiper-vue';

    const options = [
        {
            name: 'swiper1'
        },
        {
            name: 'swiper2'
        },
        {
            name: 'swiper3'
        }
    ]
</script>

全局引入

    import { createApp } from 'vue'
    import 'swiper-vue/dist/hut-es.css';
    import SwiperVue from 'swiper-vue';

    const $app = createApp(App);
    $app.use(SwiperVue);
    $app.mount('#app');`

Properties

|property|type|default|description| |:---|:---|:---|:---| |items|Array|数据源|轮播数据源,数组形式| |direction|String|horizontal|当前轮播的方向,默认为horizontal水平,vertical为垂直| |autoplay|Boolean|true|是否自动播放轮播| |delay|Number|2000|自动播放间隔,单位毫秒,默认2秒| |indicator|Boolean|true|是否显示轮播底部指示器| |mouseSlider|Boolean|true|是否开启鼠标点击轮播项左右滑动切换| |triggerMove|Number|null|鼠标点击轮播项左右滑动切换的触发值,默认为滑动该容器1/2.5宽度或者高度切换| |mouseScroll|Boolean|false|是否开启鼠标滚轮切换轮播,默认不开启| |hoverStop|Boolean|true|鼠标悬停时暂停轮播,默认为true| |arrow|String|always|左右切换箭头的显示形式,默认一直显示,值为always、hover、none| |height|Number|200|轮播容器高度| |width|Number|null|轮播容器宽度,默认为容器父元素宽度|

swiper Event

|name|description| |:---|:---| |on-change|轮播切换后触发事件,function(type:'pre'|'next',goIndex: number){}|

Swiper Slot

|name|description| |:---|:---| |default|轮播项内容,item为当前项值,index为当前索引,activeIndex为当前激活项索引,isActive为当前项是否激活| |pre-icon|轮播左切换| |next-icon|轮播右切换|