Поправил нейминг
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
import BaseInput from "@/components/base/BaseInput";
|
import BaseInput from "@/components/base/BaseInput";
|
||||||
import BaseInputContainer from "@/components/base/BaseInputContainer.vue";
|
import BaseInputContainer from "@/components/base/BaseInputContainer.vue";
|
||||||
import { ruleNumberInput } from "@/shared/utils/rulesInputs";
|
import { ruleNumberInput } from "@/shared/utils/rulesInputs";
|
||||||
import { roundedNumber } from "@/shared/utils/methodsObjects";
|
import { roundNumber } from "@/shared/utils/methodsObjects";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "BaseInputNumber",
|
name: "BaseInputNumber",
|
||||||
@@ -61,7 +61,7 @@ export default {
|
|||||||
intervalId: 0,
|
intervalId: 0,
|
||||||
timeoutId: 0,
|
timeoutId: 0,
|
||||||
ruleNumberInput: [(val) => ruleNumberInput(val, this.max, this.min)],
|
ruleNumberInput: [(val) => ruleNumberInput(val, this.max, this.min)],
|
||||||
roundedNumber: roundedNumber,
|
roundNumber: roundNumber,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -182,7 +182,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(val) {
|
value(val) {
|
||||||
this.value = this.roundedNumber(val, this.rounding);
|
this.value = this.roundNumber(val, this.rounding);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export function roundedNumber(val, digits, rounded = "floor") {
|
export function roundNumber(val, digits, rounded = "floor") {
|
||||||
let fraction = 10 * digits;
|
let fraction = 10 * digits;
|
||||||
return fraction
|
return fraction
|
||||||
? Math[rounded](val * fraction) / fraction
|
? Math[rounded](val * fraction) / fraction
|
||||||
|
|||||||
Reference in New Issue
Block a user