Plugin API
繁體中文
繁體中文
  • 入門
    • 簡介
    • 你的第一個插件
    • 檔案結構概述
    • 插件類型
      • 視窗
      • 背景服務
      • 格式擴充
      • 檢查器
    • 除錯插件
  • 部署
    • 準備插件
    • 打包插件
    • 發佈插件
    • 更新插件
    • 開發者政策
    • 插件圖示樣板
  • 開發指南
    • manifest.json 完整設定
    • 取得數據
    • 修改數據
    • 存取本機檔案
    • 發出網路請求
    • 使用 Node.js 原生 API
    • 使用第三方模快
    • 多國語言(i18n)
    • 無邊框視窗
  • API 參考
    • event(事件)
    • item(項目)
    • folder(資料夾)
    • tag(標籤)
    • tagGroup(標籤群組)
    • library(資源庫)
    • window(視窗)
    • app(應用)
    • os(作業系統)
    • screen(螢幕)
    • notification(通知)
    • contextMenu(右鍵選單)
    • dialog(對話框)
    • clipboard(剪貼板)
    • drag(拖曳檔案)
    • shell(殼)
    • log(日誌)
  • 额外组件
    • FFmpeg
Powered by GitBook
On this page
  • 方法
  • get()
  • create(options)
  • save()
  • remove()
  1. API 參考

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();
Previoustag(標籤)Nextlibrary(資源庫)

Last updated 3 months ago