Home > @xoram/plugin-panoramique > HarnessChildren
HarnessChildren type
Maps the slots advertised by a component to a list of children IDs to be bound to those same slots.
A looser openly indexed slot to children IDs record is available is the slot names can't be inferred from the component's type.
Signature:
typescript
export type HarnessChildren<component extends Component> = component extends (new (...args: unknown[]) => ComponentPublicInstance) ? {
[key in keyof InstanceType<component>['$slots']]?: ChildrenIds;
} : {
[slot: string]: ChildrenIds;
};
1
2
3
4
5
2
3
4
5
References: ChildrenIds
Example
ts
const children = {
default: ['child1', 'child2'],
header: ['cardHeader']
}
1
2
3
4
2
3
4