Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Message: fix message[type] (ElemeFE#21088)
Browse files Browse the repository at this point in the history
  • Loading branch information
cs1707 authored and CarterLi committed Nov 19, 2021
1 parent a87ab64 commit 00d4d07
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/message/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ function Message(options) {
};

['success', 'warning', 'info', 'error'].forEach(type => {
Message[type] = options => {
if (typeof options === 'string') {
options = {
message: options
};
Message[type] = (options) => {
if (options && typeof options === 'object' && !isVNode(options)) {
return Message({
...options,
type
});
}
options.type = type;
return Message(options);
return Message({
type,
message: options
});
};
});

Expand Down

0 comments on commit 00d4d07

Please sign in to comment.