import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
const messages = ['success', 'warning', 'info', 'error'];
messages.forEach(type => {
ElementUI.Message[type] = options => {
if (typeof options === 'string') {
options = {
message: options
};
// 默认配置
options.duration = 5000;
options.showClose = true;
options.offset = 40
}
options.type = type;
return ElementUI.Message(options);
};
})
Vue.use(ElementUI, { size: 'small' });
11-02
491