0.2.4 • Published 5 years ago

vue-calendar-flat v0.2.4

Weekly downloads
15
License
MIT
Repository
-
Last release
5 years ago

vue-calendar-flat

A flat style calendar component for vue,base on typescript.

demo

Getting Started

npm install vue-calendar-flat

or

yarn add vue-calendar-flat

Reference in main.js/ts

import Calendar from 'vue-calendar-flat'

Vue.use(Calendar)

Load on demand

<template>
  <div id="app">
    <Calendar :dateNote="dateNote"
      end="2020-2"
      :limit="3"
      @exceed="exceed"
      :todayHighLight='true'
      :readOnly="false"
      v-model="chose"></Calendar>
     <!-- <CalendarDayConcise :day="{
        year: 2019,
        month: 4,
        day: 3,
        disable:true
      }"></CalendarDayConcise> -->
      <div>已选:</div>
      <div v-for="(item,index) in chose" :key="index">{{item.year}}-{{item.month}}-{{item.day}}</div>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import { Calendar, CalendarDayConcise } from 'vue-calendar-flat'
@Component({
  components: {
    Calendar,
    CalendarDayConcise
  }
})
export default class App extends Vue {
  chose: {
    year:number;
    month:number;
    day:number;
  }[] = [{
    year: 2019,
    month: 4,
    day: 3
  }]

  dateNote:{}={
    20190401: '自定义',
    20190419: '自定义'
  }

  click (e: any) {
    console.log(e)
  }

  exceed () {
    console.log('====================================')
    console.log('exceed')
    alert('超过数量')
    console.log('====================================')
  }

  change (date: any) {
    console.log('====================================')
    console.log(date)
    console.log('====================================')
  }
}
</script>

Props

Calendar

attrtypeoptionsdefaultrequirednote
themeColorstring---#57D089false主题色
fontColorstring---#606266false字体颜色
disabledLineboolean---falsefalse不可点击时横线划掉
readOnlystring---falsefalse只读
limitnumber---1false选择数量限制
dateNote{ key: number: string }------false某个日期的备注
disableDatenumber:[]------false可选日期,如果不给或者为[],则默认都可以选
noteColorstring---#606266false备注颜色
value{year: number;month: number;day: number;}[]------true已选日期
startstring---${yearCurrent}-${monthCurrent}-${dayCurrent}false开始日期
endstring---9999-12-31false结束日期

CalendarDayConcise

attrtypeoptionsdefaultrequirednote
themeColorstring---#57D089false主题色
fontColorstring---#606266false字体颜色
noteColorstring---#606266false备注颜色
disabledLineboolean---falsefalse不可点击时横线划掉
activeboolean---falsefalse是否激活
todayHighLightboolean---truefalse是否高亮 今天
day{ year:number; month:number; day: number; disable: boolean; note?: string; isToday?: boolean;}------true日期信息
0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago