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

v-carousel-lucky

v1.0.2

Published

vue3版本的走马灯

Downloads

12

Readme

v-carousel-lucky

vue3版本的走马灯

安装

npm install v-carousel-lucky --save

全局引入

main.js中:

import { createApp } from 'vue'
import App from './App.vue'
//引入css文件
import "v-carousel-lucky/dist/style.css"
// 引入组件
import vCarouselLucky from 'v-carousel-lucky'
const app = createApp(App);
app.use(vCarouselLucky)
app.mount("#app")

局部引入

在你需要使用的组件里面引入:

import { Carousel, CarouselItem } from 'v-carousel-lucky'
import "v-carousel-lucky/dist/style.css"

使用案例:

<script setup>
import { Carousel, CarouselItem } from 'v-carousel-lucky'
import "v-carousel-lucky/dist/style.css"

function beforeMoving(before) {
  console.log("before", before);
}
function afterMoving(after) {
  console.log("after", after);
}
</script>

<template>
  <div class="app">
    <carousel 
    :autoplay="true" 
    :duration="5000" 
    :initIndex="0" 
    :direction="true" 
    directionMode="hover" 
    :indicator="true"
    indicatorMode="always" 
    :loop="true" 
    type="card"  
    :delay="500"
    @before-move="beforeMoving" 
    @change-move="afterMoving">
      <carousel-item v-for="item in 3" :key="item" class="item">
        <div class="h">{{ item }}</div>
      </carousel-item>
    </carousel>
  </div>
</template>

<style scoped>
.app {
  width: 500px;
  height: 300px;
}

.h,
.item {
  width: 100%;
  height: 100%;
}

.item:nth-child(1) .h {
  background-color: rgb(198, 121, 22);
}

.item:nth-child(2) .h {
  background-color: rgb(74, 56, 33);
}

.item:nth-child(3) .h {
  background-color: rgb(39, 199, 68);
}
</style>

Attribute

| 名称 | 介绍 | 可选值 | 默认值 | | :---------------: | :------------------------------: | :------------: | :---------: | | width | 轮播的宽度 | - | 400px | | height | 轮播的高度(不包含指示灯的高度) | - | 300px | | duration | 轮播延迟的时间 | - | 3000ms | | autoplay | 是否自动轮播 | true/false | true | | initIndex | 初始化展示的item | - | 0(第一个) | | direction | 是否展示切换按钮 | true/false | true | | directionMode | 切换按钮展示的方式 | always/hover | always | | indicator | 指示灯是否展示 | true/false | true | | indicatorMode | 指示灯展示方式 | always/hover | always | | indicatorPosition | 指示灯在外部还是内部 | inside/outside | inside | | indicatorTrigger | 指示灯触发方式 | hover/click | hover | | type | carousel的类型 | card | - | | loop | 是否循环轮播 | true/false | true | | delay | 切换过渡时的事件 | - | 300 | | scale | 幻灯片缩小的比例 | 小于1 | 0.8 | | cardWidth | 激活幻灯片的宽度 | 小于整体宽度 | 50% |

Event

| 名称 | 介绍 | 参数 | | :---------: | :--------------------: | :-----------------------: | | before-move | 目前激活幻灯片的前一个 | Object=>(index,direction) | | change-move | 目前激活的幻灯片 | Object=>(index,direction) |