mirror of https://github.com/ElemeFE/element
Notification: Fix modifying incoming option object (#16704)
parent
484a033a66
commit
ec3326e0bc
|
@ -1,5 +1,6 @@
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import Main from './main.vue';
|
import Main from './main.vue';
|
||||||
|
import merge from 'element-ui/src/utils/merge';
|
||||||
import { PopupManager } from 'element-ui/src/utils/popup';
|
import { PopupManager } from 'element-ui/src/utils/popup';
|
||||||
import { isVNode } from 'element-ui/src/utils/vdom';
|
import { isVNode } from 'element-ui/src/utils/vdom';
|
||||||
const NotificationConstructor = Vue.extend(Main);
|
const NotificationConstructor = Vue.extend(Main);
|
||||||
|
@ -10,7 +11,7 @@ let seed = 1;
|
||||||
|
|
||||||
const Notification = function(options) {
|
const Notification = function(options) {
|
||||||
if (Vue.prototype.$isServer) return;
|
if (Vue.prototype.$isServer) return;
|
||||||
options = options || {};
|
options = merge({}, options);
|
||||||
const userOnClose = options.onClose;
|
const userOnClose = options.onClose;
|
||||||
const id = 'notification_' + seed++;
|
const id = 'notification_' + seed++;
|
||||||
const position = options.position || 'top-right';
|
const position = options.position || 'top-right';
|
||||||
|
|
Loading…
Reference in New Issue