# BubbleList Message List Component
# Features
Message list component for displaying a group of conversation messages, supporting the following features:
- Auto scroll to latest message
- Back to bottom button
- Unified bubble style settings
- Custom scroll control
- Custom avatar and content rendering
# Usage Examples
# Basic Usage
Basic usage of the message list component to display multiple messages.
Copy
# Typewriter Effect and Auto Scroll
Demonstrate typewriter effect and auto scroll to latest message functionality.
Copy
# Back to Bottom Button
When scrolled to the top, a back to bottom button is displayed.
Copy
# Custom Slots
Use slots to customize bubble avatar and content.
Copy
# Loading State and Complex Messages
Display loading states and different types of message content.
Copy
# Attributes
| Parameter | Description | Type | Default |
|---|---|---|---|
| list | Bubble list data | Array | [] |
| maxHeight | Maximum height of the list | String | '500px' |
| triggerIndices | Indices that trigger bubble completion event, options: 'only-last'/'all'/Array | String/Array | 'only-last' |
| alwaysShowScrollbar | Whether to always show scrollbar | Boolean | false |
| backButtonThreshold | Scroll threshold for showing back to bottom button | Number | 80 |
| showBackButton | Whether to show back to bottom button | Boolean | true |
| backButtonPosition | Position of back to bottom button | Object | { bottom: '20px', left: 'calc(50% - 19px)' } |
| btnLoading | Whether button shows loading animation | Boolean | true |
| btnColor | Button color | String | '#409EFF' |
| btnIconSize | Button icon size | Number | 24 |
# Methods
| Method | Description | Parameters |
|---|---|---|
| scrollToBottom | Scroll to bottom | — |
| scrollToTop | Scroll to top | — |
| scrollToIndex | Scroll to message at specified index | index: message index |
# Events
| Event | Description | Callback Parameters |
|---|---|---|
| scroll | Triggered when scrolling | event: scroll event object |
| typing-complete | Triggered when a message typing is completed | instance: bubble instance, index: message index |
| back-to-bottom-click | Triggered when back to bottom button is clicked | — |
# Slots
| Slot Name | Description | Parameters |
|---|---|---|
| default | Custom message content | { item: message object, index: number } |
| avatar | Custom avatar | { item: message object, index: number } |
| header | Custom header content | { item: message object, index: number } |
| footer | Custom footer content | { item: message object, index: number } |
| loading | Custom loading state content | { item: message object, index: number } |
| back-to-bottom | Custom back to bottom button | — |