vue-date

datepicker component for Vue.js
25,498 153
Install
npm install vue-date
Latest Version:1.2.0
License:MIT
Last Updated:Nov 8, 2024
Links: GitHub  ·  npm
Maintainer: showonne

vue-datepicker

datepicker component for Vue.js, already support Vue.js 2.x, the Vue.js 1.x version is on branch vue-1.x(not maintain).

Live Demo is here

Installation

npm install vue-date --save

Usage

use with single .vue file:
<template>
    <div>
        <datepicker v-model="date"></datepicker>
    </div>
</template>

<script>
    import datepicker from 'vue-date'
    export default {
        data() {
            return {
                date: '2016-10-16'
            }
        },
        components: { datepicker }
    }
</script>
use in browser:
//index.html
<html>
    <script src="path/to/vue.js"></script>
    <script src="path/to/index.js"></script>
    <body>
        <div id="app">
            <datepicker v-model="date"></datepicker>
        </div>
        <script>
            new Vue({
                el: '#app',
                data: {
                    date: '2016-10-16'
                },
                components: { datepicker }
            })
        </script>
    </body>
</html>

Props

language
Type: String
Default: en
Optional: en(English), zh-cn(Chinese), uk(Ukrainsk), es(Spanish)

The language type. Support en(English), zh-cn(Chinese), uk(Ukrainsk) and es(Spanish) now.

min
Type: String
Default: 1970-01-01

The minimum date.

//pass string
<datepicker v-model="start" min="2015-01-01"</datepicker>
//or pass variable
<datepicker v-model="start" :min="variable"></datepicker>
max
Type: String
Default: 3016-01-01

The maximum date. Usage is same of min.

range
Type: Boolean
Default: false

Use range mode or not. If pass true, the binding value should be an Array containg the range start and range end. eg. ['1970-01-01', '3016-01-01']

Licence

MIT

Related Packages

vue-el-datepicker

仿element-ui日期选择器弹窗部分

1,930
auto-calendar

datepicker component for vue

672 2
vue-birth-datepicker

Date picker for distant dates, such as birthday. Just three clicks to choose any...

18,094 10
vue-date-range

A vue component for choosing dates and date ranges. Uses Moment.js for date oper...

5,383 36

Version History

Version Released License
1.2.0 MIT
1.1.10 MIT
1.1.9 MIT
1.1.7 MIT
1.1.6 MIT