mirror of https://github.com/rancher/dashboard.git
add docs for addTab about accessible Vue props + fix minor typo in panels docs (#14968)
This commit is contained in:
parent
68041cc26c
commit
85111b13cb
|
|
@ -49,7 +49,7 @@ Usage example for `'PanelLocation.DETAILS_MASTHEAD'`:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
plugin.addPanel(
|
plugin.addPanel(
|
||||||
PanelLocation.DETAILS_MASTHEAD
|
PanelLocation.DETAILS_MASTHEAD,
|
||||||
{ resource: ['catalog.cattle.io.clusterrepo'] },
|
{ resource: ['catalog.cattle.io.clusterrepo'] },
|
||||||
{ component: () => import('./MastheadDetailsComponent.vue') }
|
{ component: () => import('./MastheadDetailsComponent.vue') }
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -67,3 +67,20 @@ plugin.addTab(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 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: () => {}
|
||||||
|
},
|
||||||
|
|
||||||
|
....
|
||||||
|
```
|
||||||
Loading…
Reference in New Issue