value
value
value: Array<{ id: number; content: string; status: number; }>
this property holds an array of task objects to initialize the tasklist widget. The default property value is an empty array.
Usage
Initializing tasklist widget with data
<script>
import { Tasklist } from 'wx-svelte-tasklist';
const value = [
{
id: 7,
content: "Optimize performance in Svelte applications",
status: 1,
},
{
id: 8,
content:
"Work with API requests and data handling in Svelte applications",
status: 0,
}
];
</script>
<Tasklist {value} />
Initializing an empty tasklist widget
<script>
import { Tasklist } from 'wx-svelte-tasklist';
</script>
<Tasklist />
Initializing widget and loading tasks
<script>
import { Tasklist } from 'wx-svelte-tasklist';
let value = [];
fetch('/api/tasks')
.then(r => r.json())
.then(x => value = x);
</script>
{#await value}
<Tasklist {value} />
{/await}