add docs for addTab about accessible Vue props + fix minor typo in panels docs (#14968)

This commit is contained in:
Alexandre Alves 2025-07-30 15:31:56 +01:00 committed by GitHub
parent 68041cc26c
commit 85111b13cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View File

@ -49,7 +49,7 @@ Usage example for `'PanelLocation.DETAILS_MASTHEAD'`:
```ts
plugin.addPanel(
PanelLocation.DETAILS_MASTHEAD
PanelLocation.DETAILS_MASTHEAD,
{ resource: ['catalog.cattle.io.clusterrepo'] },
{ component: () => import('./MastheadDetailsComponent.vue') }
);

View File

@ -66,4 +66,21 @@ plugin.addTab(
component: () => import('./MyTabComponent.vue')
}
);
```
### TabLocation.RESOURCE_DETAIL accessible props
When using `addTab` in the `TabLocation.RESOURCE_DETAIL` location, the component used can have access to the given Vue properties:
- `resource`: This will pass to the component used the **resource** object (k8s resource) which can be useful to access in the component context
Usage:
```js
props: {
resource: {
type: [String, Object],
default: () => {}
},
....
```