cy-calendar-component
1.1.1 • Public • Published CY-Calendar-Component
- 基于Vue 2.0开发的轻量日历组件
- 支持自定义开始、结束日期
Install
npm i vue-calendar-component --save
Usage
- CY-Calendar-Component 提供了两个供外部调用的方法:show 和 hide,分别用于打开和关闭日期选择器。
<template>
<vCalendar
ref="calendar"
:startDate="'2018-06-17'"
:endDate="'2018-07-21'"
@GetDate="getChooseDate"
></vCalendar>
</template>
<script>
import vCalendar from 'cy-calendar-component';
export default {
components: {
vCalendar
},
methods: {
openPicker() {
this.$refs.calendar.show();
},
getChooseDate(msg){
console.log(msg); // 获取所选日期
}
}
};
</script>
API
参数 |
说明 |
类型 |
默认值 |
备注 |
cancelText |
取消按钮文本 |
String |
'取消' |
|
confirmText |
确定按钮文本 |
String |
'确定' |
|
startDate |
开始日期 |
String |
当前日期 |
格式:'2018-05-29' |
endDate |
结束日期 |
String |
一年后 |
格式:'2019-06-30' |
Events
事件名称 |
说明 |
回调参数 |
GetDate |
点击确定按钮时的回调函数 |
所选日期 |
Package Sidebar
Install
npm i cy-calendar-component
Weekly Downloads