跳至主要内容

unindent-task

描述

当任务的嵌套级别提升一级时触发

用法

"unindent-task": ({
id: string | number
}) => void;

参数

unindent-task 事件的回调函数可以接收一个包含以下参数的对象:

  • id - (必填)任务的 ID
信息

要处理内部事件,可以使用 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,
});

// 订阅 "unindent-task" 事件
list.api.on("unindent-task", ({id}) => {
console.log("The nesting level of the", id, "task is promoted by one");
});

相关文章: 任务操作