按钮禁用

This commit is contained in:
Vergil
2020-04-28 11:44:24 +08:00
parent af5fe2e9c6
commit a1bae0af76

View File

@@ -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
}
})
}
}
}