add line-height possibility
This commit is contained in:
parent
eac7acdbc6
commit
154804ee44
2 changed files with 40 additions and 3 deletions
|
|
@ -89,15 +89,17 @@ const handleInput = (event) => {
|
|||
emit('update:modelValue', value);
|
||||
};
|
||||
|
||||
const decimals = (props.step.toString().split('.')[1] || '').length;
|
||||
|
||||
const increment = () => {
|
||||
const newValue = props.modelValue + props.step;
|
||||
const newValue = parseFloat((props.modelValue + props.step).toFixed(decimals));
|
||||
if (props.max === undefined || newValue <= props.max) {
|
||||
emit('update:modelValue', newValue);
|
||||
}
|
||||
};
|
||||
|
||||
const decrement = () => {
|
||||
const newValue = props.modelValue - props.step;
|
||||
const newValue = parseFloat((props.modelValue - props.step).toFixed(decimals));
|
||||
if (props.min === undefined || newValue >= props.min) {
|
||||
emit('update:modelValue', newValue);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue