Files
docs/docs/developer-guide/plugin/extension-points/ui/plugin-installation-tabs-create.md
guqing 717ee402f4 refactor: update permission control docs for plugin (#443)
### What this PR does?
重构权限控制部分文档并调整相应结构

```release-note
None
```
2024-10-25 08:01:56 +00:00

1.3 KiB

title, description
title description
插件安装界面选项卡 扩展插件安装界面选项卡 - plugin:installation:tabs:create

目前 Halo 原生支持本地上传和远程下载的方式安装插件,此扩展点用于扩展插件安装界面的选项卡,以支持更多的安装方式。

插件安装界面选项卡

定义方式

export default definePlugin({
  extensionPoints: {
    "plugin:installation:tabs:create": (): PluginInstallationTab[] | Promise<PluginInstallationTab[]> => {
      return [
        {
          id: "foo",
          label: "foo",
          component: markRaw(FooComponent),
          props: {},
          permissions: [],
          priority: 0,
        }
      ];
    },
  },
});
export interface PluginInstallationTab {
  id: string;                       // 选项卡 ID
  label: string;                    // 选项卡标题
  component: Raw<Component>;        // 选项卡面板组件
  props?: Record\<string, unknown\>;  // 选项卡面板组件属性
  permissions?: string[];           // 选项卡 UI 权限
  priority: number;                 // 选项卡排序优先级
}

实现案例