兼容pc 和移动封装消息(弱提示)

tipsBox ( option ) {
            var _this = this ;
            if(_this.platForm){    //_this.platForm  判断平台
              _this.$message.error(option.message);  // 运用了elementUI 的组件
            }else{
                var html = '';
                html += '<div class="message-box-body" data-type="success">' + '<div class="message-box-text" >' + option.message + '</div>' + '</div>';
                $("#homePage").append(html);
                // 延迟取消
                setTimeout(function () {
                    $(".message-box-body").remove();
                },2000);
            }
        
        },

作者:人参,每篇随笔皆原创(除非注明原作者的随笔),欢迎指正!

原文地址:https://www.cnblogs.com/panax/p/14436933.html