From 91de93f212d54d9303a310a7714b961ed0589ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Wed, 28 Apr 2021 15:00:56 +0800 Subject: [PATCH] =?UTF-8?q?Button=20=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/pear/module/button.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/component/pear/module/button.js b/component/pear/module/button.js index bf9d775..64d0459 100644 --- a/component/pear/module/button.js +++ b/component/pear/module/button.js @@ -25,10 +25,13 @@ layui.define(['jquery'], function(exports) { $(option.elem).html(""); + $(option.elem).attr("disabled", "disabled"); + var buttons = $(option.elem); if (option.time != "" || option.time !=false) { setTimeout(function() { + $(option.elem).attr("disabled", false); buttons.html(text); option.done(); }, option.time); @@ -41,6 +44,7 @@ layui.define(['jquery'], function(exports) { * Button stop loaded * */ button.prototype.stop = function(success) { + $(this.option.elem).attr("disabled", false); $(this.option.elem).html(this.option.text); success && success(); }