mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
feat: add methods for message type (#594)
This commit is contained in:
parent
3c1fda6fbb
commit
533638dd1a
@ -107,5 +107,17 @@ export function closeAll(): void {
|
||||
}
|
||||
}
|
||||
|
||||
['success', 'warning', 'info', 'error'].forEach(type => {
|
||||
Message[type] = (options = {}) => {
|
||||
if (typeof options === 'string') {
|
||||
options = {
|
||||
message: options,
|
||||
type,
|
||||
}
|
||||
}
|
||||
return Message(options)
|
||||
}
|
||||
})
|
||||
|
||||
Message.closeAll = closeAll
|
||||
export default Message
|
||||
|
Loading…
Reference in New Issue
Block a user