0.1.4 • Published 7 years ago

vue-whirligig v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

vue-whirligig

A whirligig component for vue.js

Installation

Using npm

npm install vue-whirligig --save
# or 
cnpm install vue-whirligig --save

Usage

In main.js

import Vue from 'vue'
import whirligig from 'vue-whirligig'

Vue.use(whirligig)

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

In_.vue

<whirligig :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 (图片地址) 属性。

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

2018/9/6 init

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago