duplicate-card
Clones an existing card. The clone gets a new temporary id and is inserted immediately after the source card. Optional card overrides let you change fields on the clone. Set edit to open the editor on the new card.
Usage
{
id: CardID;
card?: Partial<KanbanCard>;
edit?: boolean;
}
| Field | Type | Description |
|---|---|---|
id | CardID | Id of the card to clone |
card | Partial<KanbanCard> | Fields to override on the clone (optional) |
edit | boolean | Open the editor on the cloned card when true |
Trigger
api.exec("duplicate-card", { id: 42 });
With overrides:
api.exec("duplicate-card", {
id: 42,
card: { label: "Copy of Task" },
edit: true,
});
Observe
api.on("duplicate-card", ev => {
console.log("duplicated card", ev.id);
});
Intercept
api.intercept("duplicate-card", ev => {
// prevent duplicating locked cards
return !isLocked(ev.id);
});
Component handler
<Kanban :onduplicatecard="ev => console.log('duplicated', ev.id)" />
Related
- Cards guide - card actions overview
- add-card - create a card from scratch
- delete-card - remove a card