api.serialize()
Description
Serilizes and returns the list of current tasks in GanttUsage
api.serialize(): ITask[];
Returns
Returns an array of current tasks in Gantt: ITask[]. Each element in the array is the tasks object.
Example
The example shows how to serialize tasks and output them to console:
<script setup>
import { getData } from "../data";
import { Gantt } from "@svar-ui/vue-gantt";
const data = getData();
function init(api) {
const tasks = api.serilalize();
console.log("Serialized tasks:", tasks);
}
</script>
<template>
<Gantt
:tasks="data.tasks"
:links="data.links"
:init="init"
/>
</template>
Related articles: