2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-05 05:32:27 +03:00
2017-10-19 20:46:47 +08:00
2017-10-19 20:46:47 +08:00
2017-09-13 13:16:20 +08:00
fix
2017-08-12 19:05:10 +08:00
2017-05-09 13:54:06 +08:00
2017-08-15 23:48:41 +08:00
2017-05-09 14:17:59 +08:00
2017-09-13 13:23:14 +08:00
2017-10-19 20:39:55 +08:00
fix
2017-05-26 14:23:09 +08:00

vue2-datepicker

A Datepicker Component For Vue2

Demo

https://mengxiong10.github.io/vue2-datepicker/

image

Install

$ npm install vue2-datepicker --save

Usage

<script>
import DatePicker from 'vue2-datepicker'

export default {
  components: { DatePicker },
  data() {
    return {
      time1: '',
      time2: '',
      shortcuts: [
        {
          text: 'Today',
          start: new Date(),
          end: new Date()
        }
      ]
    }
  }
}
</script>

<template>
  <div>
    <date-picker v-model="time1" :first-day-of-week="1"></date-picker>
    <date-picker v-model="time2" range :shortcuts="shortcuts"></date-picker>
  </div>
</template>

Attributes

Prop Type Default Description
range Boolean false if true, the type is daterange
format String yyyy-MM-dd Date formatting string
lang String zh Translation (en/zh/es/pt-br/fr)
placeholder String input placeholder text
width String/Number 210 input size
disabled-days Array [] Days in YYYY-MM-DD format to disable
not-before String '' Disable all dates before date in YYY-MM-DD format
not-after String '' Disable all dates after date in YYY-MM-DD format
shortcuts Boolean/Array true the shortcuts for the range picker
first-day-of-week Number 7 set the first day of week (1-7)

shortcuts

  • true - show the default shortcuts
  • false - hide the shortcuts
  • Object[] - custom shortcuts, [{text, start, end}]
Prop Type Description
text String Text
start Date Start Date
end Date End Date
S
Description
No description provided
Readme MIT 3 MiB
Languages
JavaScript 63%
Vue 29.2%
SCSS 6.1%
Shell 0.9%
HTML 0.8%