Created
March 19, 2017 17:42
-
-
Save sir4ju1/72554c49c1b5799aef027d2eaa09f1cb to your computer and use it in GitHub Desktop.
example how to integrate fullcalendar to nuxt vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<section> | |
<div id="calendar"></div> | |
</section> | |
</template> | |
<script> | |
// $.fn.fullCalendar = fullCalendar | |
export default { | |
middleware: '', | |
head () { | |
return { | |
title: `Calendar`, | |
} | |
}, | |
fetch ({ store }) { | |
store.commit('SET_HEAD', ['Calendar', 'View all your appointments.']) | |
}, | |
mounted () { | |
window.$ = window.jQuery = require('jquery') | |
const FC = require('fullcalendar') | |
$('#calendar').fullCalendar({ | |
header: { | |
left: 'prev,next today', | |
center: 'title', | |
right: 'month,basicWeek,basicDay' | |
}, | |
defaultDate: '2017-02-12', | |
navLinks: true, // can click day/week names to navigate views | |
editable: true, | |
eventLimit: true, // allow "more" link when too many events | |
events: [ | |
{ | |
title: 'All Day Event', | |
start: '2017-02-01' | |
}, | |
{ | |
title: 'Long Event', | |
start: '2017-02-07', | |
end: '2017-02-10' | |
}, | |
{ | |
id: 999, | |
title: 'Repeating Event', | |
start: '2017-02-09T16:00:00' | |
}, | |
{ | |
id: 999, | |
title: 'Repeating Event', | |
start: '2017-02-16T16:00:00' | |
}, | |
{ | |
title: 'Conference', | |
start: '2017-02-11', | |
end: '2017-02-13' | |
}, | |
{ | |
title: 'Meeting', | |
start: '2017-02-12T10:30:00', | |
end: '2017-02-12T12:30:00' | |
}, | |
{ | |
title: 'Lunch', | |
start: '2017-02-12T12:00:00' | |
}, | |
{ | |
title: 'Meeting', | |
start: '2017-02-12T14:30:00' | |
}, | |
{ | |
title: 'Happy Hour', | |
start: '2017-02-12T17:30:00' | |
}, | |
{ | |
title: 'Dinner', | |
start: '2017-02-12T20:00:00' | |
}, | |
{ | |
title: 'Birthday Party', | |
start: '2017-02-13T07:00:00' | |
}, | |
{ | |
title: 'Click for Google', | |
url: 'http://google.com/', | |
start: '2017-02-28' | |
} | |
] | |
}) | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment