Skip to main content

undo

PRO

The functionality is available in PRO Edition only

Description​

Allows performing steps back in history

It's required to enable the undo property to perform the action.

Actions that can be undone: add-task, update-task, add-link, update-link, delete-task, delete-link, move-task, copy-task.

Hot key for the action: Ctrl/Meta + Z

Usage​

"undo": () => void;

Parameters​

The callback of the action takes no parameters.

Example​

We enable the undo action on a button click.

<script setup>
import { Gantt } from "@svar/vue-gantt";
import { Button } from "@svar-ui/vue-core";
import { getData } from "../data";
import { ref } from "vue";

const { tasks, links } = getData();

const api = ref(null);

function undo() {
api.value.exec("undo");
}
</script>

<template>
<Button :onclick="undo">Undo</Button>
<Gantt ref="api" :tasks="tasks" :links="links" undo />
</template>

Related samples:

Related articles: