Files
halo/ui/docs/extension-points/plugin-self-tabs.md
Ryan Wang ac88ee70cb Rename @halo-dev/console-shared to @halo-dev/ui-shared (#7926)
#### What type of PR is this?

/area ui
/kind api-change
/milestone 2.22.x

#### What this PR does / why we need it:

See #7925 

#### Which issue(s) this PR fixes:

Fixes #7925 

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
将 `@halo-dev/console-shared` 重命名为 `@halo-dev/ui-shared`
```
2025-11-10 16:20:41 +00:00

925 B

插件详情选项卡扩展点

原由

部分插件可能需要在 Console 端自行实现 UI 以完成一些自定义的需求,但可能并不希望在菜单中添加一个菜单项,所以希望可以在插件详情页面添加一个自定义 UI 的选项卡。

定义方式

import { definePlugin, PluginTab } from "@halo-dev/ui-shared";
import MyComponent from "@/views/my-component.vue";
import { markRaw } from "vue";
export default definePlugin({
  components: {},
  routes: [],
  extensionPoints: {
    "plugin:self:tabs:create": () : PluginTab[] => {
      return [
        {
          id: "my-tab-panel",
          label: "Custom Panel",
          component: markRaw(MyComponent),
          permissions: []
        },
      ];
    },
  },
});

PluginTab 类型:

export interface PluginTab {
  id: string;
  label: string;
  component: Raw<Component>;
  permissions?: string[];
}