tagGroup(标签群组)
透过 eagle.tagGroup API 可以方便存取当前应用中的标签群组。
// 取得所有标签群组
const tagGroups = (await eagle.tagGroup.get());方法
get()
获取所有标签群组。
返回
Promise<tagGroups: Object[]>- tagGroups 查询结果。
const tagGroups = (await eagle.tagGroup.get());create(options)
获取所有标签群组。
返回
Promise<tagGroup: Object>- 新建立的标签群组
await eagle.tagGroup.create({
name: "new group",
color: "red",
tags: ["tag1", "tag2"]
});实例方法
save()
保存标签群组修改。
返回
Promise<tagGroup: Object>- 保存结果。
const tagGroups = (await eagle.tagGroup.get());
const tagGroup = tagGroups[0];
tagGroup.name = "new name";
tagGroup.color = "red"; // red, orange, yellow, green, aqua, blue, purple, pink
tagGroup.tags = ["tag1", "tag2"];
await tagGroup.save();remove()
删除标签群组。
返回
Promise<result: boolean>- result是否删除成功
const tagGroups = (await eagle.tagGroup.get());
const tagGroup = tagGroups[0];
await tagGroup.remove();最后更新于