A simple calendar selection component based on vue.Js!
npm install vue-calendars![npm]()
> A simple calendar selection component based on vue.js!You can customize which day is not optional, or you can define subscripts for each day (or days). Single or multiple(/interval) choice!
#### install
By npm
`` bash
npm install vue-calendars --save
`
or download code and include it
` shell
`
Register component globally!
` javascript
// Your entry main.js
import Vue from 'vue'
import App from './App.vue'
import vCalendar from "vue-calendars"
Vue.use(vCalendar)
new Vue({
el: '#app',
render: h => h(App)
})
`
or register locally in your .vue file
` html
选择日期:
开始时间:{{ selectDate[0] }}
:click-action="setSelectDate"
:multi-selection="isMultiple"
:interval-selection="isInterval"
:subscript="subscript"
:items-subscript="itemsSubscript"
/>
``
A sample screenshot is here,
Option | Description
---|---
option | 传入一组object aroud(当前日期),如当前日期为2018/04/25 around为3 则显示2018/04 2018/05 2018/06 3个月;open(是否显示日历),true(显示) or false(隐藏); title(要显示的标题), string
click-action | 选择日期之后执行的方法,可接方法名,返回的是一个包含日期的数组
multi-selection | 是否多选,true(多选) or false(单选)
interval-selection | 是否区间选择,与多选冲突,如果同时设true则按多选操作
subscript | 所有日期的下标
items-subscrip | 选择哪些日期不可选,或哪些日期的自定义下标
* 有什么问题欢迎随时提Issues!😊