vue-fullcalendar
Works for Vue2 now. This is a fullCalendar component based on vue.js . No Jquery or fullCalendar.js required. Currently, It only supports month view. It's inspired by fullCalendar.io but not cloned by it. So please read the docs here below to understand all features.
install
By NPM
@latest
works for Vue2
0.1.11
works for Vue1.*
//
or download code and include it
<script src='dist/vue-fulcalendar.min.js'>
Usage
Register component globally
// Your entry index.js Vue // Vue2 el : '#app' template : '<App/>' components : App //Vue1 el : 'body' components : App
or register locally in your .vue
file
Example
var demoEvents = title : 'Sunny Out of Office' start : '2016-08-25' end : '2017-07-27' { return fcEvents : demoEvents } components : 'full-calendar':
A sample screenshot is here,
Docs
props
-
events : Events will be displayed on the calendar
events =title : 'event1'start : '2016-07-01',cssClass : 'family'YOUR_DATA : {}title : 'event2'start : '2016-07-02'end : '2016-07-03'cssClass : 'family' 'career'YOUR_DATA : {}-
title
is the title of this event, will be displayed on calendar -
start
is the start day of this event -
end
is the end day of this event -
cssClass
is css class of each event label, such that, you will be able to set different colors, style .. -
YOUR_DATA
You can define as many data you want as possible
-
-
locale : langague of things like monthNames weekNames and titleFormat. Support same locales than moment.js
default
:en
-
firstDay : first day of the week,
Number
, default: 0 (Sunday) Sunday=0, Monday=1, Tuesday=2, etc. Any number smaller than 0 or larger than 6 will be set to 0.default
: 0
events
fc will dispatch some events out.
-
changeMonth : Every time you click arrow to next/last month, fc will dispatch changeMonth
this-
start
is the first day of current monthView (moment
object) -
end
is the last day of current monthView (moment
object) -
current
is the first day of current month (moment
object)
-
-
eventClick : Every time you click a event, fc will dispatch eventClick
this-
event
is an Event object hold the event's information -
jsEvent
holds the native javascript event -
pos
is the relative coordinates of fc
-
-
dayClick : fc dispatch it when you click a day slot.
this-
date
is a Date Object of the day you click (moment
object) -
jsEvent
holds the native javascript event
-
-
moreClick : fc dispatch it when you click a
more
button-
date
is the date corresponding to the "more" clicked (moment
object) -
events
is the list of events that will be in the box -
jsEvent
holds the native javascript event
-
slots
You will be able to register your own stuff by using slots
-
fc-header-left : top left area
-
fc-header-right : top right area. In my case, I added a filter menu there
-
fc-body-card : inside the body area, usually working with
EventClick
, to display a event detail