纯js中使用Message、MessageBox的方法

常规是在全局引入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,
             });
   }
 
posted @ 2018-12-07 10:45  小口木子  阅读(8584)  评论(0编辑  收藏  举报