ăă©ăă°ïŒăăăă ăă©ă°ă€ăł
ăă©ăă°ïŒăăăăăă©ă°ă€ăłăŻăă«ăŹăłăăŒă°ăȘăăäžă§çŽæ„ă€ăăłăăç§»ćăăȘă”ă€ășăäœæă§ăăă€ăłăżă©ăŻăăŁăăȘă€ăăłăçźĄçæ©èœăæäŸăăŸăă
ă€ăłăčăăŒă«
ăć„œăżăźăăă±ăŒăžăăăŒăžăŁăŒăäœżçšăăŠăă©ă°ă€ăłăă€ăłăčăăŒă«ăăŸăïŒ
npm install @dayflow/plugin-drag
pnpm add @dayflow/plugin-drag
yarn add @dayflow/plugin-drag
bun add @dayflow/plugin-drag
import { createDragPlugin } from '@dayflow/plugin-drag';äœżăæč
import { useCalendarApp, DayFlowCalendar } from '@dayflow/react';
import { createDragPlugin } from '@dayflow/plugin-drag';
function MyCalendar() {
const dragPlugin = createDragPlugin({
enableDrag: true,
enableResize: true,
enableCreate: true,
onEventDrop: (updated, original) => {
console.log('Event moved:', updated);
},
onEventResize: (updated, original) => {
console.log('Event resized:', updated);
},
});
const calendar = useCalendarApp({
views: [
/* ăă„ăŒ */
],
plugins: [dragPlugin],
});
return <DayFlowCalendar calendar={calendar} />;
}<template>
<DayFlowCalendar :calendar="calendar" />
</template>
<script setup>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/vue';
import { createDragPlugin } from '@dayflow/plugin-drag';
const dragPlugin = createDragPlugin({
enableDrag: true,
enableResize: true,
enableCreate: true,
onEventDrop: (updated, original) => {
console.log('Event moved:', updated);
},
onEventResize: (updated, original) => {
console.log('Event resized:', updated);
},
});
const calendar = useCalendarApp({
views: [
/* ăă„ăŒ */
],
plugins: [dragPlugin],
});
</script>import { Component } from '@angular/core';
import { DayFlowCalendarModule } from '@dayflow/angular';
import { createDragPlugin } from '@dayflow/plugin-drag';
@Component({
selector: 'app-root',
standalone: true,
imports: [DayFlowCalendarModule],
template: `<dayflow-calendar [calendar]="calendar"></dayflow-calendar>`
})
export class AppComponent {
calendar = {
views: [
/* ăă„ăŒ */
],
plugins: [
createDragPlugin({
enableDrag: true,
enableResize: true,
enableCreate: true,
onEventDrop: (updated, original) => {
console.log('Event moved:', updated);
},
onEventResize: (updated, original) => {
console.log('Event resized:', updated);
},
})
]
};
}<script>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
import { createDragPlugin } from '@dayflow/plugin-drag';
const dragPlugin = createDragPlugin({
enableDrag: true,
enableResize: true,
enableCreate: true,
onEventDrop: (updated, original) => {
console.log('Event moved:', updated);
},
onEventResize: (updated, original) => {
console.log('Event resized:', updated);
},
});
const calendar = useCalendarApp({
views: [
/* ăă„ăŒ */
],
plugins: [dragPlugin],
});
</script>
<DayFlowCalendar {calendar} />èšćźé çź
| ăăăă㣠| ć | ăăă©ă«ă〠| èȘŹæ |
|---|---|---|---|
enableDrag | boolean | true | ăă©ăă°ă«ăăă€ăăłăăźç§»ćăèš±ćŻăăăă©ăăă |
enableResize | boolean | true | ăă©ăă°ă«ăăă€ăăłăæéăźć€æŽăèš±ćŻăăăă©ăăă |
enableCreate | boolean | true | ă°ăȘăăăźăăă«ăŻăȘăăŻă«ăăă€ăăłăäœæăèš±ćŻăăăă©ăăă |
enableAllDayCreate | boolean | true | ç”æ„èĄă§ăźăă©ăă°ă«ăăç”æ„ă€ăăłăăźäœæăèš±ćŻăăăă©ăăă |
supportedViews | ViewType[] | [DAY, WEEK, MONTH, YEAR] | ăă©ăă°æ©èœăæćčă«ăȘăăă„ăŒăźăȘăčăă |
onEventDrop | Function | - | ă€ăăłăăç§»ćïŒăă©ăă°ïŒăăăăïŒăăăæăźăłăŒă«ăăăŻă |
onEventResize | Function | - | ă€ăăłăăăȘă”ă€ășăăăæăźăłăŒă«ăăăŻă |
ăă©ă°ă€ăł API
ăă©ăă°ă”ăŒăăčă«ăąăŻă»ăčăăŠăèšćźăćçă«æŽæ°ă§ăăŸăïŒ
const dragService = calendar.app.getPlugin<DragService>('drag');
// ćçă«ăȘă”ă€ășæ©èœăçĄćčă«ăă
dragService.updateConfig({ enableResize: false });