From a1bae0af76246141aa40d85442bb14b82347ef47 Mon Sep 17 00:00:00 2001 From: Vergil <974548713@qq.com> Date: Tue, 28 Apr 2020 11:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AmountInputBox/AmountInputBox.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/AmountInputBox/AmountInputBox.js b/src/components/AmountInputBox/AmountInputBox.js index 3332bd83..59e1e978 100644 --- a/src/components/AmountInputBox/AmountInputBox.js +++ b/src/components/AmountInputBox/AmountInputBox.js @@ -39,7 +39,12 @@ const checkFloat = (e, reg, charcode, el) => { } } } - +const loading = (e, el, bind) => { + el.disabled = true + setTimeout(function() { + el.disabled = false + }, 5000) +} /** * @author LeeYunxiang * @description 限制数字输入格式 int => 正整数 , num => 自然数(正整数包括0) , float => 正数包括小数(建议用text类型的input表单) @@ -75,6 +80,13 @@ export default { break } }) + el.addEventListener('click', e => { + switch (bind.value) { + case 'loading': + loading(e, el, bind) + break + } + }) } } }