mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* refactor(utils-v2): migrate utils * refactor(utils-v2): migrate utils * refactor(utils-v2): migrate utils * refactor(utils): remove * refactor(utils): rename * refactor(utils): move EVENT_CODE to constants * refactor: remove generic
45 lines
949 B
TypeScript
45 lines
949 B
TypeScript
import { TypeComponentsMap, buildProps, keysOf } from '@element-plus/utils'
|
|
import type { ExtractPropTypes } from 'vue'
|
|
import type Alert from './alert.vue'
|
|
|
|
export const alertEffects = ['light', 'dark'] as const
|
|
|
|
export const alertProps = buildProps({
|
|
title: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
description: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
type: {
|
|
type: String,
|
|
values: keysOf(TypeComponentsMap),
|
|
default: 'info',
|
|
},
|
|
closable: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
closeText: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
showIcon: Boolean,
|
|
center: Boolean,
|
|
effect: {
|
|
type: String,
|
|
values: alertEffects,
|
|
default: 'light',
|
|
},
|
|
} as const)
|
|
export type AlertProps = ExtractPropTypes<typeof alertProps>
|
|
|
|
export const alertEmits = {
|
|
close: (evt: MouseEvent) => evt instanceof MouseEvent,
|
|
}
|
|
export type AlertEmits = typeof alertEmits
|
|
|
|
export type AlertInstance = InstanceType<typeof Alert>
|