0.2.6 • Published 5 years ago

vue-calendar-easy v0.2.6

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

vue-calendar-easy

install

npm install vue-calendar-easy --save

Usage

<template>
  <vue-calendar v-model="value" />
</template>

<script>
import VueCalendar from 'vue-calendar-easy'

export default {
  components: {
    VueCalendar
  },
  data () {
    return {
      value: null // Default selected date
    }
  }
}
</script>

Options

Props

PropsTypeDefaultDescription
valueDatenullDefault selected date
daterangeBooleannullOptional date range
begin_date.syncDatenullWhen :daterange="true" is true, default start date
end_date.syncDatenullWhen :daterange="true" is true, default end date
lazyBooleantrueWhen :daterange="true" is true, allow lazy loading
one_calendarBooleanfalseWhen :daterange="true" is true, display a single calendar
separatorString~Separator symbol
defaultNextMonthBooleantrueIn multi-calendar mode, true shows the current month and next month, false shows last month and current month
pickerStringdateCalendar type, "date" / "month" / "year"
yearsNumber20Year range
year_startNumber2000Start year
rulesArray< String >[]Built-in filtering method, optional value please see below.
custom_filterFunction-Please see below.
mark_todayBooleantrueMark today
calendar_widthString'300px'Calendar width
calendar_heightString'250px'Calenfar height
header_heightString'40px'Header height
no_borderBooleanfalseDisplay border
formatStringyyyy-MM-ddGet formatted value
/*
 * @param date  日期
 * @param type  日历类型 [date, month, year]
 * @param index 索引 (默认为0,当 daterange 时为 0 或 1)
 */
function custom_filter (date, type, index) {
  // 返回 true 则禁用
  return Boolean
}

const rules = [
  'fromToday', // 从今天起(包含今天)
  'fromTomorrow', // 从明天起(不包含今天)
  'untilToday', // 直至今天(包含今天)
  'untilTomorrow', // 直至明天(不包含今天)
  'unableSun', // 禁用周日
  'unableMon', // 禁用周一
  'unableTues', // 禁用周二
  'unableWed', // 禁用周三
  'unableThur', // 禁用周四
  'unableFri', // 禁用周五
  'unableSat' // 禁用周六
]

event

eventDescriptionCallback Arguments
completeCallback when the date changesdate(type: object) / date_range(type: object), format_date(type: string)

slot

slotDescriptionSlot variables
defaultCustom Calendarin_range< Boolean >, year < Number >, month < Number >, day < Number >
monthCustom Month Calendaryear < Number >, month < Number >
yearCustom Year Calendaryear < Number >
0.2.6

5 years ago

0.2.5

5 years ago

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.1.9

5 years ago

0.1.8

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

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago