1.0.12 • Published 5 months ago

drag-time-picker-vue2 v1.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

拖拽时间选择器

demo

Attributes

参数说明类型默认值备注
value / v-model绑定值IValue必填值
range时间范围24 | 482424 代表 24 小时,也就是 1 天(当前仅支持 24 或 48)
disabled禁用booleanfalse值为 true 则不可选择时间
step步长number3030 分钟,每个小时会被分割为 2 格(60 / step)
needPeriod控制时间段区显隐booleanfalse时间段区可通过点击快速选中常规时段可选值参考ITimePeriod
periodList自定义时间段IPeriodList如上图自定义时间段的区间根据 timePeriod 字段去计算格数所以必须是00:00~24:00的字符串形式
type IValue = Array<{
  startTime: string;
  endTime: string;
}>;

type ITimePeriod = {
  timePeriod: string; // "00:00~24:00"
  label: string; // "全天" "早餐" "午高峰" "下午茶" "晚高峰" "夜宵1" "夜宵2"
  key: string; // "allDay"
  selected: boolean; // false
};

type IPeriodList = Array<ITimePeriod>;

Events

事件名称说明回调参数备注
change值变化时触发(Value: IValue)
custom-time-period-change点击时间段区的按钮时触发(Value: ITimePeriod)
on-clear点击清空选择时触发
on-error错误回调函数(errMsg: string)触发内部错误规则,比如选择时间不能超过24小时
1.0.12

5 months ago

1.0.11

5 months ago

1.0.9

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.0

5 months ago