Socket
Socket
Sign inDemoInstall

vue-schedule-selector

Package Overview
Dependencies
12
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-schedule-selector

this is a schedule selector for vue


Version published
Weekly downloads
25
increased by400%
Maintainers
2
Install size
15.3 MB
Created
Weekly downloads
 

Readme

Source

vue-schedule-selector

vue-schedule-selector

一个友好的 when2meet 风格的网格时间选择器,使用date-fns构建。

Live example

Install

npm install vue-schedule-selector

Usage

<ScheduleSelector
              :minTime="minTime"
              :maxTime="maxTime"
              :numDays="numDays"
              :selection="schedule"
              :half-hour="halfHour"
              :auto-complete="autoComplete"
              :show-date="showDate"
              @onChange="handleDateChange"/>
import ScheduleSelector from "./components/ScheduleSelector";

export default {
  name: "schedule",
  // inheritAttrs: false,
  data() {
    return {
      minTime: 7, // 最小时间 0
      maxTime: 20, // 最大时间 23
      numDays: 7, // 显示天数
      schedule: [], // 时间
      halfHour: true, // 是否显示半小时
      autoComplete: false, // 是否开启自动补全
      showDate: false, // 是否显示星期
    };
  },
  components: {
    ScheduleSelector
  },
  mounted() {},
  methods: {
    handleDateChange(newSchedule, customizeDate) {
      // 自定义日期只显示最小时间和最大时间,不需要可以不接受第二参数 
      console.log(customizeDate);
      // 如果不赋值,则每次都是重新选择
      this.schedule = newSchedule;
    },
  }
};

Keywords

FAQs

Last updated on 16 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc