# Prompts
# Features
The Prompts component is used to display interactive prompt options, suitable for guided selection, quick operations, and other scenarios in AI conversations. It supports the following features:
- Switch between horizontal and vertical layouts
- Automatic wrapping and fixed layouts
- Nested prompt structures
- Custom styles and icons
- Disable state control
# Usage Examples
# Basic Usage
Copy
# Vertical Layout
Copy
# Wrap Layout
Copy
# Disabled State
Copy
# Custom Layout
# Custom Width and Style
Copy
# Custom Styles
Copy
# Nested Prompts
Copy
# Attributes
Attribute | Description | Type | Default |
---|---|---|---|
items | A list of prompt items | Array | [] |
title | Title displayed at the top of the list | String | '' |
vertical | Whether the list is vertically arranged | Boolean | false |
wrap | Whether the list items should wrap | Boolean | false |
styles | Custom styles for different parts | Object | {} |
classNames | Custom class names for different parts | Object | {} |
rootClassName | The class name for the root node | String | '' |
customStyle | Custom style | Object | {} |
direction | Direction | String | 'ltr' |
# items Data Structure
[
{
key: 'unique_key', // Unique identifier
icon: 'el-icon-star-off', // Icon class name
iconStyle: { color: '#FFD700' }, // Icon style
label: 'Option Title', // Option title
description: 'Option description text', // Option description
disabled: false, // Whether it is disabled
children: [], // Nested child options
},
// more options...
];
# styles Object Structure
{
title: {}, // Title style
list: {}, // List container style
item: {}, // Option item style
itemContent: {}, // Option content style
subList: {}, // Sub-list style
subItem: {} // Sub-option style
}
# classNames Object Structure
{
title: '', // Title class name
list: '', // List container class name
item: '', // Option item class name
itemContent: '', // Option content class name
subList: '', // Sub-list class name
subItem: '' // Sub-option class name
}
# Events
Event Name | Description | Callback Parameters |
---|---|---|
on-item-click | Triggered on item click | { data: item } item is the clicked item object |
# Slots
Slot Name | Description | Scope Parameters |
---|---|---|
icon | Custom icon content | { item } current prompt item |
label | Custom label content | { item } current prompt item |
description | Custom description content | { item } current prompt item |