jk-calendar

1.1.3 • Public • Published

vue日历组件,支持日期回显

安装

npm install jk-calendar -S

快速开始

<template>
    <div>
        <v-calendar :echotDate="echoDate" @getYearAndMonth="getYMD" @getDetail="getDe"></v-calendar>
    </div>
</template>
import vCalendar from 'jk-calendar'

export default {
  name:'Your Component Name',
  components: {
    vCalendar
  },
  data(){
    // 回显日期数据
    echoDate:[
      {
        year:2018,
        month:6,
        day:4
      }
    ]
  },
  methods:{
    getDe(val){
      // 点击后返回的详细日期
      console.log(val)
    },
    getYMD(val){
      // 点击后返回的年月
      console.log(val)
    }
  }
}

API

Name type Example
echoDate Array [{year:2018,month:6,day:4}...]
getDetail event 子传父的详细日期(年月日)
getYearAndMonth event 子传父的日期(年月)

##更新日志 1.1.3: 修复回显日期的bug(现只回显当月的) 增加获取年月的方法

Readme

Keywords

Package Sidebar

Install

npm i jk-calendar

Weekly Downloads

2

Version

1.1.3

License

ISC

Unpacked Size

8.66 kB

Total Files

4

Last publish

Collaborators

  • jkhuangfu