1.1.1 • Published 6 years ago

cy-calendar-component v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

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点击确定按钮时的回调函数所选日期
1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago