1. 程式人生 > 實用技巧 >vue訊息提示this.$message方法

vue訊息提示this.$message方法

//彈出資訊  th傳的是this
function alertMessage(th,action,a){
    var msg,type;
    switch(a){
        case '1':
            type='success';
            msg = action+'成功';
            break;
        case '2':
            type='warning';
            msg = action;
            break;
        case '3':
            type
='info'; msg = '取消'+action; break; case '4': type='error'; msg = action+'失敗'; break; default: break; } th.$message({ message: msg, type: type, }); } //彈出資訊 alertMessage(th,action,msg){
this.$message({ message: msg, type: action, }); }, ———————————————— 原文連結:https://blog.csdn.net/qq_41488724/java/article/details/87935456

this.$message.warning("領取截止時間不能小於結束日期");