Files
element-plus/packages/components/result/src/result.ts
一只前端汪 7c16480bcd refactor(style): Update Eslint to V9 and Prettier to V3 (#21949)
* refactor(style): Update Eslint to V9 and Prettier to V3

* fix: vscode color

* fix: vscode color

* chore: remove Useless dependence and old config file

* chore: format

* Merge branch 'dev' into eslintV9

* fix: fix

* fix: ssr test

* fix: ssr test

* fix: use defineConfig

* fix: prettier format and ignore docs dist

* fix: index.mjs => index.js

* fix: Vscode color

* fix: prettier ignore global.d.ts

* fix: format

---------

Co-authored-by: 2586740555 <15972343+CYJ090915@user.noreply.gitee.com>
2025-09-29 14:14:30 +08:00

60 lines
1.3 KiB
TypeScript

import { buildProps } from '@element-plus/utils'
import {
CircleCheckFilled,
CircleCloseFilled,
InfoFilled,
WarningFilled,
} from '@element-plus/icons-vue'
import type { Component, ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'
import type Result from './result.vue'
export const IconMap = {
primary: 'icon-primary',
success: 'icon-success',
warning: 'icon-warning',
error: 'icon-error',
info: 'icon-info',
} as const
export const IconComponentMap: Record<
(typeof IconMap)[keyof typeof IconMap],
Component
> = {
[IconMap.primary]: InfoFilled,
[IconMap.success]: CircleCheckFilled,
[IconMap.warning]: WarningFilled,
[IconMap.error]: CircleCloseFilled,
[IconMap.info]: InfoFilled,
}
export const resultProps = buildProps({
/**
* @description title of result
*/
title: {
type: String,
default: '',
},
/**
* @description sub title of result
*/
subTitle: {
type: String,
default: '',
},
/**
* @description icon type of result
*/
icon: {
type: String,
values: ['primary', 'success', 'warning', 'info', 'error'],
default: 'info',
},
} as const)
export type ResultProps = ExtractPropTypes<typeof resultProps>
export type ResultPropsPublic = __ExtractPublicPropTypes<typeof resultProps>
export type ResultInstance = InstanceType<typeof Result> & unknown