diff --git a/lib/kanban/README.md b/lib/kanban/README.md index e8881e2a70..66d74b9ada 100644 --- a/lib/kanban/README.md +++ b/lib/kanban/README.md @@ -3,5 +3,27 @@ ## 示例 ```html:example: bg-surface -
+| undefined; + if (onDropNewItem) { + newItem = onDropNewItem.call(this, info); + } else { + newItem = $(drag.element).data(); + if (newItem?.item) { + newItem = newItem.item; + } + } + newItem = { + lane: drop.lane, + col: drop.col, + ...newItem, + }; + if (newItem) { + const colItems = data.items[drop.lane!][drop.col!]; + const newColItems = [...colItems]; + newColItems.push(newItem); + changes.items = newColItems; + changeData.list.push(newItem[itemKey] as string); + } } return {changes, data: changeData}; } @@ -376,12 +403,13 @@ export class Kanban
= { item: '.kanban-item', lane: '.kanban-lane-name', col: '.kanban-header-col', + newItem: '.kanban-new-item', }; const userOptions = typeof draggable === 'object' ? draggable : {}; const updateDropElementAttr = (dropElement: HTMLElement, info?: KanbanDropInfo) => { @@ -393,7 +421,7 @@ export class Kanban
dragTypeSelectors[x] || '').join(''), + selector: userOptions.selector || dragTypeList.map(x => dragTypeSelectors[x] || '').filter(Boolean).join(','), target: userOptions.target || ((dragElement: HTMLElement) => { const info = this._getElementInfo(dragElement); if (!info) { @@ -403,6 +431,7 @@ export class Kanban
boolean | void;
onDragStart?: (info: KanbanDragInfo) => void | boolean;
onDrop?: (changes: Partial