users
설명
선택 사항. 사용자 데이터를 포함하는 객체 배열을 지정합니다
사용법
users?: [
{
id: string | number,
label: string,
avatar?: string,
color?: string,
},
{...} // 추가 사용자 객체
];
파라미터
users 속성은 사람 객체 배열을 나타냅니다. 각 객체는 다음 파라미터 집합을 포함합니다:
id- (필수) 사람의 idlabel- (필수) 사람의 설명avatar- (선택 사항) 사람의 이미지 경로color- (선택 사항) 이미지가 업로드되지 않은 경우 아이콘의 색상
정보
color 파라미터가 지정되지 않으면 기본 색상 세트의 색상이 적용됩니다.
예제
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,
});
관련 문서: