주요 콘텐츠로 건너뛰기

check-task

설명

작업이 완료로 표시될 때 발생합니다

사용법

"check-task": ({
id: string | number,
manual?: boolean
}) => void;

매개변수

check-task 이벤트의 콜백은 다음 매개변수를 포함한 객체를 받을 수 있습니다:

  • id - (필수) 작업의 ID
  • manual - (선택) "수동" 모드에서 작업이 완료로 표시된 경우 true
정보

내부 이벤트를 처리하려면 Event Bus 메서드를 사용할 수 있습니다

예제

const { ToDo, Toolbar } = todo;
const {tasks, projects, users} = getData();

const list = new ToDo("#root", {
tasks,
projects,
users
});

const toolbar = new Toolbar("#toolbar", {
api: list.api,
});

// "check-task" 이벤트 구독
list.api.on("check-task", ({id}) => {
console.log("The", id, "task is marked as completed");
});

관련 문서: 작업 관련 작업