mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-11 01:42:34 +00:00
Fixed #3802 - Improve folder structure for nuxt configurations
This commit is contained in:
parent
851950270b
commit
f5fe822afb
563 changed files with 1703 additions and 1095 deletions
64
components/lib/fullcalendar/FullCalendar.vue
Executable file
64
components/lib/fullcalendar/FullCalendar.vue
Executable file
|
@ -0,0 +1,64 @@
|
|||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import '@fullcalendar/core/vdom'; // vite support
|
||||
import { Calendar } from '@fullcalendar/core';
|
||||
|
||||
export default {
|
||||
name: 'FullCalendar',
|
||||
props: {
|
||||
events: Array,
|
||||
options: null
|
||||
},
|
||||
calendar: null,
|
||||
watch: {
|
||||
events(value) {
|
||||
if (value && this.calendar) {
|
||||
this.calendar.removeAllEventSources();
|
||||
this.calendar.addEventSource(value);
|
||||
}
|
||||
},
|
||||
options(value) {
|
||||
if (value && this.calendar) {
|
||||
for (let prop in value) {
|
||||
this.calendar.setOption(prop, value[prop]);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.$el.offsetParent) {
|
||||
this.initialize();
|
||||
}
|
||||
},
|
||||
updated() {
|
||||
if (!this.calendar && this.$el.offsetParent) {
|
||||
this.initialize();
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
if (this.calendar) {
|
||||
this.calendar.destroy();
|
||||
this.calendar = null;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initialize() {
|
||||
let defaultConfig = { themeSystem: 'standard' };
|
||||
let config = this.options ? { ...this.options, ...defaultConfig } : defaultConfig;
|
||||
|
||||
this.calendar = new Calendar(this.$el, config);
|
||||
this.calendar.render();
|
||||
|
||||
if (this.events) {
|
||||
this.calendar.removeAllEventSources();
|
||||
this.calendar.addEventSource(this.events);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
Loading…
Add table
Add a link
Reference in a new issue