Socket
Book a DemoInstallSign in
Socket

@aidol/vue-carousel

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@aidol/vue-carousel

A carousel component for vue.js

0.2.0
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

A carousel component for vue.js

Installation

Using npm

npm install @aidol/vue-carousel --save
# or 
cnpm install @aidol/vue-carousel --save

Usage

In main.js

import Vue from 'vue'
import AiCarousel from '@aidol/vue-carousel'

Vue.use(AiCarousel)

// new Vue({ //...})

In_.vue

<ai-carousel :containerWidth="800" :containerHeight="300" :currWidth="400" :currHeight="280" :data="imgList" @jump="jumpTo" />
export default {
  data(){
    return {
      imgList: [
        {src: ""}
        // ...
      ]
    }
  },
  methods: {
    jumpTo(info){
      // `info` is the data which you setted before 
      // so something when you click current main img
    }
  }
}

Properties

属性类型说明可选值默认值是否必需
containerWidthNumber容器宽度-800
containerHeightNumber容器高度-300
currWidthNumber中间主图宽度-400
currHeightNumber中间主图高度-280
scaleNumber两侧卡片缩放比例-0.8
autoplayBoolean是否自动播放falsetrue
intervalNumber自动播放间隔毫秒数-3000
dataArray of object展示数据-本地演示数据

注:

data props 为对象数组类型, 且每个对象中必须包含 src (图片地址) 属性。

[
  { src: 'http://www.example/a.png', alt: '图片加载出错了', title: '这是图片 title' },
  { src: 'http://www.example/b.png', alt: '图片加载出错了', title: '这是图片 title' },
  { src: 'http://www.example/c.png', alt: '图片加载出错了', title: '这是图片 title' }
  // ...
]

图片的数据个数最好为 奇数,这样布局会比较协调。

Events

@jump

点击主图时触发句柄

export default {
  data(){
    return {}
  },
  methods: {
    jumpTo(info){
      // `info` is the data which you setted before 
      // so something when you click current main img
    }
  }
}

Logs

  • 2020/6/24 rebuild

  • 2018/9/6 init

Keywords

carousel

FAQs

Package last updated on 24 Jun 2020

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.