Socket
Socket
Sign inDemoInstall

github.com/lsycxyj/vue-l-carousel

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/lsycxyj/vue-l-carousel


Version published
Created
Source

A responsive carousel(namely slider or swiper) component for Vue.js v2.x+. Live demo

Pull requests are welcome :)

Build Status Coverage

License

LGPL-V3
License: LGPL v3

Features

  • Responsive carousel component for both desktop and mobile devices.
  • No extra dependencies except Vue
  • High performance with GPU acceleration and transition animations
  • Available to be styled with CSS
  • Event-based API and notification

Installation

vue-l-carousel

npm install vue-l-carousel

Usage

    <carousel :auto="3000" :watch-items="list">
        <carousel-item v-for="(item, index) in list">
            <p>CarouselItem{{index}}, URL is {{item.url}}</p>
        </carousel-item>

        <div slot="before">Insert node before</div>
        <div slot="after">Insert node after</div>
    </carousel>
import { Carousel, CarouselItem } from 'vue-l-carousel'
export default {
    data() {
        return {
            auto: 3000,
            list: [
                {
                    url: 'url1'
                },
                {
                    url: 'url2'
                },
                {
                    url: 'url3'
                },
            ]
        }
    },
    components: {
        'carousel': Carousel,
        'carousel-item': CarouselItem
    }
}

props

NameTypeDefaultDescription
prev-htmlString<HTML content of the previous button.
next-htmlString>HTML content of the next button.
speedNumber300The time of the transition animation. In ms.
loop[2]Booleanfalse It can go to next/previous slide at the ends if it's set to true. It works only the items' length more than 1.
rewind[2]BooleanfalseRewind to the other end instead of endless loop, but you can only go to the other end by previous or next button, if it's set to true. It works only loop is set to true.
mouse-dragBooleanfalseIt can be drag by mouse if it's set to true.
autoNumber0Autoplay interval. In ms. 0 for no autoplay.
dotsBooleantruePagination is available if it's set to true.
dots-style[Object, String, Array]
''
Style of v-carousel-dots
watch-items[1][2]Array
[]
The original data list used to render the CarouselItems. The component will rerender if this property changes.

Notice:

[1]: Required props
[2]: Changing it will cause render-update event.

events

NameDirectionArgumentsDescription
changed-indexEmit
{  
    index, // Current index
    total, // Total amount of items
    item, // Item data of current index
}
                
It emits when index changed.
render-updatedEmit-It emits when render updated.
nextReceive-Make carousel go to the next slide.
prevReceive-Make carousel go to the previous slide.
toReceive
index
Make carousel go to the specific index of slide.

TODO list

  • Vertical orientation support
  • Load resources via AJAX
  • Add components for dots
  • Multiple items in the same page
  • More elegant way to test behaviors

FAQs

Package last updated on 01 Feb 2017

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc