Skip to content

Conversations Session Management Component ๐Ÿ“ฑ โ€‹

Introduction โ€‹

Conversations is a session management component developed based on Vue 3 and Element Plus, supporting grouped display, menu interaction, scroll loading, custom styles and other features. Suitable for message lists, file management, task grouping and other scenarios, it meets diverse business needs through flexible configuration and slot extensions.

Code Examples โ€‹

Basic Usage โ€‹

Get selected session information through @change event. v-model:active binds the currently selected session.

Time Grouping and Sticky Effect โ€‹

  • today
    yesterday
    ๆœชๅˆ†็ป„

Automatically groups by the group field of session items, group titles stick to top when scrolling, enhancing navigation experience.

Custom Group Sorting โ€‹

  • ๐Ÿ“š Study
    ๐Ÿ“Š Work
    ๐Ÿ  Personal
    ๐Ÿ“ ๆœชๅˆ†็ป„

Pass sorting function through groupable property to customize group order (e.g.: Study > Work > Personal > Ungrouped).

Built-in Dropdown Menu โ€‹

Built-in basic menu functionality (rename, delete), supports menu command callbacks, easily implements quick operations for session items.

@menu-command triggers built-in menu click events.

Custom Menu Interaction โ€‹

Extend menu content through slots, supports icons, text and custom commands, meets complex business logic.

Lazy Loading Feature โ€‹

Automatically triggers loading more data when scrolling to bottom, supports loading state display, optimizes performance for large data scenarios.

Custom Styles and Group Titles โ€‹

  • ๐Ÿ“š Study
  • Menu Test Item 4
  • Menu Test Item 5
  • Menu Test Item 6
  • Menu Test Item 7
๐Ÿ“Š Work
  • Menu Test Item 1 - Long text effect demonstration text length overflow effect testMenu Test Item 1 - Long text effect demonstration text length overflow effect test
  • Menu Test Item 2
  • Menu Test Item 3
  • ๐Ÿ  Personal
  • Menu Test Item 8
  • Menu Test Item 9
  • Menu Test Item 10
  • Menu Test Item 11
  • ๐Ÿ“ ๆœชๅˆ†็ป„
  • Menu Test Item 12
  • Menu Test Item 13
  • Menu Test Item 14
  • Customize session item appearance and group title icons through slots and style properties, supports hover, active, menu opened state style customization.

    Properties โ€‹

    Property NameTypeRequiredDefaultDescription
    itemsConversationItem<T>[]No[]Session item data list, containing label, group, disabled and other fields
    groupableboolean | GroupableOptionsNofalseWhether to enable grouping, passing object can customize group sorting (sort function)
    showBuiltInMenubooleanNofalseWhether to show built-in menu (rename, delete)
    loadMore() => voidNo-Lazy loading callback function, triggered when scrolling to bottom
    loadMoreLoadingbooleanNofalseLoad more state, controls loading animation display
    showToTopBtnbooleanNofalseWhether to show back to top button
    labelKeystringNo'label'Session item label field name
    rowKeystringNo'id'Session item unique identifier field name
    itemsStyleCSSPropertiesNo{}Session item default style
    itemsHoverStyleCSSPropertiesNo{}Session item hover style
    itemsActiveStyleCSSPropertiesNo{}Session item active style
    itemsMenuOpenedStyleCSSPropertiesNo{}Session item style when menu is opened

    Slots โ€‹

    Slot NameParametersDescription
    #groupTitle{ group: GroupItem }Custom group title, supports adding icons or special styles
    #label{ item: ConversationItem<T> }Custom session item label content, supports text overflow handling or rich text
    #more-filled{ item, isHovered, isActive, isMenuOpened, isDisabled }Session item right side additional content, displays status indicators (e.g.: disabled mark, action icons)
    #menu{ item: ConversationItem<T> }Custom menu content, supports buttons, icons or complex interactive components
    #header-Container header slot, for adding search bars, filter buttons and other custom content
    #footer-Container footer slot, for adding pagination, statistics and other custom content

    Events โ€‹

    EventParametersDescription
    @menuCommand(command: ConversationMenuCommand, item: ConversationItem): voidMenu command callback, supports rename, delete and other operations. If you choose custom menu, this method is disabled, you need to handle menu click logic yourself.
    :loadMore--Bind lazy loading callback, triggered when scrolling to bottom

    Features โ€‹

    1. Flexible Group Management
    • Automatically groups by group field, ungrouped items are unified under "Ungrouped" title
    • Supports custom group sorting (through groupable.sort function), implements business logic customization
    • Group title sticky display, maintains navigation visibility when scrolling
    1. Rich Interaction Support
    • Built-in basic menu (rename, delete), supports monitoring command callbacks through @menu-command
    • Custom menu slots, easily extend sharing, editing and other complex operations
    • Session item state styles independently configured (default, hover, active, menu opened), clear visual feedback
    1. Performance Optimization
    • Lazy loading feature: automatically loads more data when scrolling to bottom, reduces initial rendering pressure
    • Virtual scrolling (planned): supports ultra-large list scenarios, improves memory usage efficiency
    1. Highly Customizable
    • Full style properties: customize session item appearance through itemsStyle series properties
    • Deep slot extensions: labels, group titles, menu content can all be completely customized through slots
    • Responsive design: supports adaptive width and scrollbar hiding, adapts to different container sizes