Result
Brief Introduction
The Result component is used to display the status of an operation result.
You can use <MYResult></MYResult> to display a result.
Basic Usage
Use the title prop to set the main title and the subTitle prop to set the subtitle.
Code Demo
Operation Successful
Your operation has been completed successfully
展开代码
Icon Types
Use the icon prop to set the result icon.
Code Demo
Primary Result
This is a primary result
Success Result
Operation completed successfully
Warning Result
Please pay attention to related matters
Error Result
Operation failed, please try again
Info Result
This is an information message
展开代码
Slot Usage
Use slots to customize the subtitle and extra content.
Code Demo
Operation Successful
Custom subtitle content with HTML support
展开代码
Combined Usage
Finally, here is a combination of multiple APIs to create a result page:
Code Demo
Combined Usage Example
This is a complete example of combined usage
展开代码
API Reference
Props
| Prop | Description | Type | Options | Default |
|---|---|---|---|---|
| title | Main title | string | — | '' |
| subTitle | Subtitle | string | — | '' |
| icon | Icon type | string | primary/success/warning/error/info | 'info' |
Slots
| Name | Description |
|---|---|
| sub-title | Custom subtitle content |
| extra | Extra content area |
Type Definitions
typescript
interface ResultProps {
title?: string;
subTitle?: string;
icon?: 'primary' | 'success' | 'warning' | 'error' | 'info';
}