純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,
             });
   }
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM