update-link
Description
Fires when updating a linkUsage
"update-link": ({
id: string | number,
link: Partial<ILink>
}) => boolean | void;
Parameters
The callback of the update-link action can take an object with the following parameters:
id- (required) the id of a linklink- (required) the links object
info
For handling the actions you can use the Event Bus methods
Example
In the example below we apply the api.exec method to trigger the action with a button click:
<script setup>
import { getData } from "./common/data";
import { Gantt } from "@svar-ui/vue-gantt";
import { Button } from "@svar-ui/vue-wx";
import { ref } from "vue";
const data = getData();
const api = ref(null);
const updateLink = () => {
api.value.exec("update-link", {
id: 1,
link: { type: 3 }
});
};
</script>
<template>
<Button :onclick="updateLink" type="primary">Update Link</Button>
<Gantt
:tasks="data.tasks"
:links="data.links"
ref="api" />
</template>
Related articles: