0.0.2 • Published 6 months ago

time-line-choice v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

install

npm install time-line-choice 

or

yarn add time-line-choice

use

全局注册

import { TimeLineChoice } from time-line-choice
vue.use(TimeLineChoice)

按需引入

import { TimeLineChoice } from time-line-choice

    components: {
        TimeLineChoice
    }

Attributes

属性属性名是否必填默认值类型
最小时间minHour0string/number
最大时间maxHour24string/number
一格对应时间(分钟)unit30string/number
一格表示的时段对应的刻度scale0.5string/number
被他人预定disabledList{name:'',time:0}array
被我预定checkedList[]array
dom节点domRef""string
传入时间date""string 提前多少小时

Events

事件名称说明回调参数
getHours获取返回参数组件绑定值
clearHours重置其它time-line组件状态组件绑定值
默认状态
<time-line domRef="vs" @getHours="getHours" :clear="clear=='vs'" @clearHours="clearHours"/>
被我选择过的时段
<time-line domRef="vs3" :minHour="7" :maxHour="23" :checkedList="[12,12.5,13.5]"  @getHours="getHours" :clear="clear=='vs3'" @clearHours="clearHours"/>
其它人选择过的时段
<time-line domRef="vs18" :minHour="10" :maxHour="21" :disabledList="[{name:'张三',time:15},{name:'李四',time:15.5},{name:'王五',time:16}]" @getHours="getHours" :clear="clear=='vs18'" @clearHours="clearHours"/>
传递时间
<time-line domRef="vs19" :date="'2020-06-08'" :minHour="10" :maxHour="21" @getHours="getHours" :clear="clear=='vs19'" @clearHours="clearHours"/>
/**
*
* 获取选择后的参数
**/
getHours(e) {
    this.$message({
        type: 'success',
        message: JSON.stringify(e)
    })
}
/**
*   借助父组件的clear实现组件互相触发重置功能
**/
clearHours(e) {
    this.clear = e
}