跳至主要内容

openInlineEditor()

描述

打开任务/项目的内联编辑器

用法

openInlineEditor({
id: string | number,
type?: "task" | "project"
}): void;

参数

  • id - (必填)任务/项目的 id
  • type - (可选)条目的类型:"task"(默认)或 "project"

示例

const { ToDo, Toolbar } = todo;

const list = new ToDo("#root", {
tasks: [
{ id: "1", text: "Task 1 #tag1" },
{ id: "1.1", text: "Task 1.1", parent: "1" },
{ id: "1.1.1", text: "Task 1.1.1", parent: "1.1" },
{ id: "1.2", text: "Task 1.2", parent: "1" },
]
});

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

// 打开任务的内联编辑器
list.openInlineEditor({
id: "1.1.1",
});

相关文章: 内联编辑