按钮禁用
This commit is contained in:
@@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user