Introduction/API Usage
Update Component
Dynamically update mounted component configuration using the update method
Use the update method to dynamically update the configuration of a mounted component without recreating the component instance.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| container | string | 'body' | CSS selector for mount container |
| config | Partial<ChatConfig> | - | Configuration items to update (incremental update) |
Return Value
| Return | Type | Description |
|---|---|---|
| success | boolean | true indicates success, false indicates no component found for the container |
Basic Usage
Update Multiple Config Items
Update API Configuration
Update User Information
Update i18n Configuration
Use with getProps
Notes
- The
updatemethod can only update components initialized via theinitmethod - The passed configuration will be merged with existing config (incremental update), won't override unpassed items
- If the component is not initialized, a warning will be logged and
falsewill be returned - Updates take effect immediately, the component will automatically re-render
getProps - Get Current Configuration
Use the getProps method to get the current configuration of a mounted component.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| container | string | 'body' | CSS selector for mount container |
Return Value
| Return | Type | Description |
|---|---|---|
| props | Record<string, any> | undefined | Current component config object, undefined if not found |