npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

drag-time-picker-vue2

v1.0.12

Published

drag-time-picker-vue2

Downloads

27

Readme

拖拽时间选择器

demo

Attributes

| 参数 | 说明 | 类型 | 默认值 | 备注 | | --- | --- | --- | --- | --- | | value / v-model | 绑定值 | IValue | | 必填值 | | range | 时间范围 | 24 | 48 | 24 | 24 代表 24 小时,也就是 1 天(当前仅支持 24 或 48) | | disabled | 禁用 | boolean | false | 值为 true 则不可选择时间 | | step | 步长 | number | 30 | 30 分钟,每个小时会被分割为 2 格(60 / step) | | needPeriod | 控制时间段区显隐 | boolean | false | 时间段区可通过点击快速选中常规时段可选值参考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小时 |