docs(skill): plugin bundle pipeline v2 (IIFE/多资产/热更新) 文档入仓
This commit is contained in:
@@ -59,9 +59,17 @@ ctx.addContextMenuAction(id: string, component: React.FC): Disposable;
|
||||
ctx.addPanel(id: string, component: React.FC): Disposable;
|
||||
ctx.addDashboardWidget(id: string, component: React.FC): Disposable;
|
||||
ctx.addView(id: string, component: React.FC): Disposable;
|
||||
ctx.addRoute(path: string, component: React.FC): Disposable;
|
||||
ctx.addRoute(id: string, component: React.FC): Disposable;
|
||||
```
|
||||
|
||||
**Route position** (full-page apps, since 2026-10): the component renders at
|
||||
`/base/<baseId>/p/<pluginId>` — the whole main-area viewport inside the base
|
||||
layout, so SDK hooks like `host.SDK.useBaseId()` work. Install the plugin at
|
||||
position `"route"` (`POST /api/base/:baseId/plugin-installs`) and include
|
||||
`"route"` in `manifest.positions`. The plugin brings its own router — use
|
||||
HashRouter (e.g. `react-router-dom` bundled as a normal npm dep) so Next.js
|
||||
routing is untouched. Working example: `plugins/plugin-showcase/src/App.tsx`.
|
||||
|
||||
### Events
|
||||
|
||||
#### `ctx.on(event, handler): Disposable`
|
||||
|
||||
Reference in New Issue
Block a user