mirror of
https://github.com/halo-dev/halo.git
synced 2025-12-20 16:44:38 +08:00
#### 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` ```
925 B
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[];
}