跳至主要内容

open-inline-editor

描述

当打开任务/项目的内联编辑器时触发

用法

"open-inline-editor": ({
id: string | number,
type: "task" | "project"
}) => void;

参数

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

  • id - (必填)任务/项目的 ID
  • type - (必填)条目的类型:"task" 或 "project"
信息

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

// 订阅 "open-inline-editor" 事件
list.api.on("open-inline-editor", ({id, type}) => {
console.log("The inline editor is opened for the", type, "with ID:", id);
});

相关文章: 内联编辑