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();Last updated