Use lt.property/setting validatiors to set numerical input range and step
This commit is contained in:
parent
4326bb2075
commit
cd14f470f6
2 changed files with 21 additions and 6 deletions
|
|
@ -25,6 +25,9 @@
|
|||
:class="{ edited: isEdited, flash: animateUpdate }"
|
||||
:disabled="isDisabled"
|
||||
type="number"
|
||||
:min="minimum"
|
||||
:max="maximum"
|
||||
:step="step"
|
||||
@input="grabFocus"
|
||||
@focusout="focusOut"
|
||||
@keydown="keyDown"
|
||||
|
|
@ -242,6 +245,18 @@ export default {
|
|||
}
|
||||
return "other";
|
||||
},
|
||||
maximum() {
|
||||
if (this.dataType !== "number") return undefined;
|
||||
return this.dataSchema.maximum;
|
||||
},
|
||||
minimum() {
|
||||
if (this.dataType !== "number") return undefined;
|
||||
return this.dataSchema.minimum;
|
||||
},
|
||||
step() {
|
||||
if (this.dataType !== "number") return undefined;
|
||||
return this.dataSchema.multipleOf;
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue