Home > @xoram/plugin-panoramique > addChild
addChild() function
Register a component as the child of another when the host plugin is created and sever the link on teardown. Additionally, flag the host component as depending on panoramique's plugin.
Signature:
typescript
export declare function addChild<parent extends Component = Component>(parent: string, child: string, slot?: keyof ComponentSlots<parent> & string, index?: number): void;
1
Parameters
Parameter | Type | Description |
---|---|---|
parent | string | id of the parent component to register the child into. |
child | string | id of the child component. |
slot | keyof ComponentSlots<parent> & string | (Optional) name of the slot to add the child into. Defaults to the |
index | number | (Optional) index, in the given slot, where the child should be inserted. Negative numbers are handled like |
Returns:
void