redo
Description
Allows performing steps forward in historyIt's required to enable the undo property to perform the action.
Usage
"redo": () => void;
Parameters
The callback of the action takes no parameters.
Example
We enable the redo action on a button click. The action cannot be executed in the tree mode.
Actions that can be redone: add-row, update-row, update-cell, delete-row, move-item, collapse-column, resize-column, hide-column.
<script setup>
import { Button } from "@svar-ui/vue-core"; // import the Button component
import { Grid } from "@svar-ui/vue-grid";
import { getData } from "../data";
import { ref } from "vue";
const { data, columns } = getData();
const api = ref();
function redo() {
api.value.exec("redo");
}
</script>
<template>
<Button :onclick="redo">Redo</Button>
<div style="height: 400px; margin-top: 10px;">
<Grid
ref="api"
:data="data"
:columns="columns"
undo
/>
</div>
</template>
Related articles: