常規是在全局引入message,但是如果我想在二次封裝的純.js文件里面使用:
import { Message } from
'element-ui'
function(){
Message({
showClose: true,
message: ‘消息提示’,
type: 'error',
duration: 1000 })
}
同樣MessageBox也可以這樣使用
import { MessageBox } from 'element-ui';
function(){
MessageBox.alert(
res.data.errorDescription,
'',
{ customClass:'ajax-error',
showConfirmButton:false,
});
}