mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
add .type on Notification and Message
This commit is contained in:
committed by
cinwell.li
parent
805e8fc112
commit
3d60efd468
@@ -32,6 +32,18 @@ var Notification = function(options) {
|
||||
instances.push(instance);
|
||||
};
|
||||
|
||||
['success', 'warning', 'info', 'error'].forEach(type => {
|
||||
Notification[type] = options => {
|
||||
if (typeof options === 'string') {
|
||||
options = {
|
||||
message: options
|
||||
};
|
||||
}
|
||||
options.type = type;
|
||||
return Notification(options);
|
||||
};
|
||||
});
|
||||
|
||||
Notification.close = function(id, userOnClose) {
|
||||
let index;
|
||||
let removedHeight;
|
||||
|
||||
Reference in New Issue
Block a user