Code Monkey home page Code Monkey logo

vue-time-play's Introduction

vue-time-play

基于vue的时间播放器组件

##使用

1、

npm install vue-play-time --save
//main.js中引入
import vuePlayTime from 'vue-play-time'
Vue.use(vuePlayTime);

2、

<vue-time-play :options="options" @onAnimate="onAnimate" @onClickEnd=“onClick”></vue-time-play>
options = {
   speedConfig: {
     "慢": 5000,
     "中":3000,
     "快":1000,
   },
   speed:1000,
   startDate:'2018-07-01 ',
   endDate:'2018-07-09',
   timeUnitControl: true,
   timeUnit: '天'
}

options参数说明

param option type description
speedConfig optional json 播放速度配置,例如{"慢": 5000,"中":3000,"快":800}
speed optional number 播放速度,必须和配置中的速度保持一致,默认:800
startDate required string 播放的开始时间
endDate required string 播放的结束时间
timeUnit optional string 按天或小时播放,默认按天
timeUnitControl optional boolean 是否显示时/天切换控件

onAnimate:时间轴动画每次结束的回调,回调参数是当前时间

onClickEnd:点击时间轴的回调,回调参数是当前时间

onClickUnit:切换天/小时的回调,回调参数hour或day

vue-time-play's People

Contributors

xiemengyan avatar molly0313 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.