0.0.2 • Published 3 years ago

vue-timelinepick-syx v0.0.2

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

Vue-Timelinepick

时间范围选择插件 取当前时间之前一段时间范围 按刻,小时,天分类

demo地址

npm.io

dependencies

  • jquery <=2.x
  • d3 < 4.x
  • createjs
  • tweenMax

Examples

引入依赖文件

import timelinepick from "vue-timelinepick"
import "vue-timelinepick/dist/vue-timelinepick.css"

Vue.use(timelinpick)

vue组件中直接使用

<timelinepick :option="op" :width="width" :height="height" :handler="changeAction"></timelinepick>

data() {
      return {
          "width": 1200,
          "height":110,
          "op" : {
              "threshold": new Date(),
              "number": 97,
              "spanMinNumber": 10,
              "isFixedDrag" : true,
              "spanIndex": {start: 70, end: 97},
              "type": "quarter",
              "dateFormat" : 'yyyy-MM-dd mm:hh:ss'
          }
      }
  },
methods:{
    changeAction(e){
        this.startTime = e.startTime;
        this.endTime = e.endTime;
    }
}

props

属性说明
width
height
option配置项

options

属性说明
threshold起点时间(默认当前) new Date()
number总刻度 97
isFixedDrag是否禁止拖拽 false
spanIndex起始滑块范围 {start: 70, end: 97}
type刻度类型 "quarter"
dateFormat格式 'yyyy-MM-dd mm:hh:ss'