Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/Aaron00101010/vue-split-carousel

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Aaron00101010/vue-split-carousel

  • v0.0.0-20230320060156-74be56d94e05
  • Source
  • Go
  • Socket score

Version published
Created
Source

中文文档

GitHub

A carousel component for vue,meanwhile display several carousel item.

show

2.x version for vue 3

1.x version for vue 2

1.x version doc

Playground

Browser Compatibility

Modern browser, follow vue 3 compatibility.

Component Structure

Use <split-carousel-item> in <split-carousel>,put your custom content in split-carousel-item.

<split-carousel>
  <split-carousel-item>
    custom content
  </split-carousel-item>
  <split-carousel-item>
    custom content2
  </split-carousel-item>
</split-carousel>

Install

# use npm
npm i vue-split-carousel
# use yarn
yarn add vue-split-carousel

support prefix option prevent name conflict while install component with app.use

Local Component

<template>
  <div id="app">
    <split-carousel>
      <split-carousel-item v-for="item in 8" :key="item">
        {{ item }}
      </split-carousel-item>
    </split-carousel>
  </div>
</template>

<script>
  import { SplitCarousel, SplitCarouselItem } from "vue-split-carousel";
  export default {
    components: {
      SplitCarousel,
      SplitCarouselItem
    }
  };
</script>

Global Component

import Vue from "vue";
import App from "./App.vue";
import SplitCarousel from "vue-split-carousel";

const app = createApp(App);
app.use(SplitCarousel);

//accpect prefix for component name conflict, use as `<ElSplitCarousel>` and `<ElSplitCarouselItem>`
//app.use(SplitCarousel,{prefix:'El'});

app.mount("#app");

import by <script>

can use vue-split-carousel.min.umd.js in the dist folder.

<div id="app"></div>
<script src="https://unpkg.com/vue@next"></script>
<script src="./vue-split-carousel.umd.min.js"></script>
<script>
  const app = Vue.createApp({
    template:`
      <split-carousel>
        <split-carousel-item v-for="i in 8">{{i}}</split-carousel-item>
      </split-carousel>
    `
  })
  app.use(window['vue-split-carousel'])
  app.mount('#app')
</script>

Props

AttributeDescriptionTypeAccpected ValuesDefault
speedtransition duration of carousel item, in millisecondsNumber-500
autoplaywhether automatically switch carousel itemsBoolean-true
intervalinterval of switch carousel items, in millisecondsNumber-3000
loopwhether display carousel items in loopBoolean-true
display-amountthe amount of carousel items display in carousel containerNumber-4
item-widththe width of carousel itemsNumber-120
heightheight of carousel, if the prop value type is number,the unit is px by default. you can pass string value to use other unit, eg: 40vhNumber/String-80
timing-functionthe animation effect of carousel item,reference transition-timing-functionString-ease
pause-on-hoverwhether pause autoplay while mouse hoverBoolean-true
arrow-visiblewhether arrow visiable, avaliable when loop set to falseStringdefault/alwaysdefault

Slots

NameDescrition
leftcustomize left arrow
rightcustomize right arrow

License

MIT

FAQs

Package last updated on 20 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc