1.0.4 • Published 5 years ago

vuejs-date-dropdown v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Vue Date Dropdown

A Vue date dropdown component

Contents

Installing

npm install vue-date-dropdown --save

yarn add vue-date-dropdown
import DateDropdown from 'vuejs-date-dropdown'

export default {
	...
	components: {
		DateDropdown
	},
	data () {
		return {
			selectedDate: '',
			...
		}
	}
	...
}

Or if you are using CDN version

<script src="vue-date-dropdown.min.js"></script>

<script>
Vue.use(DateDropdown)

new Vue({
	...
	data() {
		return {
			selectedDate: '',
			...
		}
	}
	...
});
<script>

Examples

See the demo in the example folder.

Setting a default date

<date-dropdown default="1990-12-25" v-model="selectedDate" />

Setting a min date

<date-dropdown min="1960" v-model="selectedDate" />

Setting a max date

<date-dropdown max="2020" v-model="selectedDate" />

Setting a range of dates

<date-dropdown min="1960" max="2020" v-model="selectedDate" />

Setting Russian names of months

<date-dropdown
	v-model="selectedDate" 
	months-names="一, 二, 三, 四, 五, 六, 七, 八, 九, 十, 十一, 十二">
<date-dropdown>

API

Props

NameTypeDescription
defaultStringSet default date.
minStringLimits the year to a minimum specified value.
maxStringLimits the year to a maximum specified value.
months-namesStringThe alternative names of month.