users
Description
Optional. An array of user objects
Usage
users?: [
{
id: string | number,
label: string,
avatar?: string,
color?: string,
},
{...} // more user objects
];
Parameters
The users property presents an array of user objects. Each object includes the following set of parameters:
id
- (required) the id of a userlabel
- (required) the description of the useravatar
- (optional) a path to the image of the usercolor
- (optional) the color of the user if the image isn't uploadedinfo
If the color parameter is not specified, the color from the default set of colors will be applied.
Example
const { ToDo, Toolbar } = todo;
const tasks = [
{
id: "1",
project: "books",
// parent: null,
text: "Read books",
collapsed: false,
due_date: new Date()
},
{
id: "2",
project: "books",
parent: "1",
text: "Don Quixote",
assigned: [ "user_1" ],
},
{
id: "3",
project: "books",
parent: "1",
text: "The Great Gatsby",
assigned: [ "user_2" ],
checked: true,
},
];
const users = [
{
id: "user_1",
label: "John",
avatar: "../avatar_02.jpg"
},
{
id: "user_2",
label: "Kate",
avatar: "../avatar_03.jpg"
},
];
const projects = [
{ "id": "books", "label": "Books" },
];
const list = new ToDo("#root", {
tasks,
users,
projects
});
const toolbar = new Toolbar("#toolbar", {
api: list.api,
});
Related articles: