mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fixed #3827 - FullCalendar: Deprecated component
This commit is contained in:
parent
ac87f9a5d5
commit
977a6b560f
8 changed files with 789 additions and 1157 deletions
34
components/lib/fullcalendar/FullCalendar.d.ts
vendored
34
components/lib/fullcalendar/FullCalendar.d.ts
vendored
|
@ -1,34 +0,0 @@
|
|||
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
||||
|
||||
export interface FullCalendarProps {
|
||||
events?: any[];
|
||||
options?: object;
|
||||
}
|
||||
|
||||
export interface FullCalendarSlots {}
|
||||
|
||||
export declare type FullCalendarEmits = {};
|
||||
|
||||
declare class FullCalendar extends ClassComponent<FullCalendarProps, FullCalendarSlots, FullCalendarEmits> {}
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
interface GlobalComponents {
|
||||
FullCalendar: GlobalComponentConstructor<FullCalendar>;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* PrimeVue provides theming for the FullCalendar Vue component.
|
||||
*
|
||||
* Helper API:
|
||||
*
|
||||
* - [FullCalendar](https://fullcalendar.io/docs/vue)
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [FullCalendar](https://primevue.org/fullcalendar)
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export default FullCalendar;
|
|
@ -1,64 +0,0 @@
|
|||
<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>
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"main": "./fullcalendar.cjs.js",
|
||||
"module": "./fullcalendar.esm.js",
|
||||
"unpkg": "./fullcalendar.min.js",
|
||||
"types": "./FullCalendar.d.ts",
|
||||
"browser": {
|
||||
"./sfc": "./FullCalendar.vue"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue