Skip to content

Commit

Permalink
dFed: fix the bug that input form does not support scientific countin…
Browse files Browse the repository at this point in the history
…g (2)
  • Loading branch information
Diorzz committed Dec 13, 2020
1 parent 25055a3 commit 4f93283
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/common/components/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default class FeInput extends Vue{
@Watch('val')
valChange(nval){
console.log(nval)
if(/e/g.test(nval)){
this.$message.error('Scientific notation is not supported. Please use plain numbers.')
}else{
Expand All @@ -72,13 +71,13 @@ export default class FeInput extends Vue{
}
const val = this.val === '' ? this.val : Number(this.val);
if(this.isRequire && val === ''){
this.val = this.defaultValue || this.min
}else if(val < this.min){
this.val = this.defaultValue || this.min
this.val = (this.defaultValue || this.min).toString()
}else if(val < 0){
this.val = Math.abs(this.val)
this.val = Math.abs(this.val).toString()
}else if(val < this.min){
this.val = (this.defaultValue || this.min).toString()
}else if(val > this.max){
this.val = this.defaultValue || this.max
this.val = (this.defaultValue || this.max).toString()
}
this.$emit('onBlur')
}
Expand Down

0 comments on commit 4f93283

Please sign in to comment.