A2683 fix decimal value page crash on scale input (#420)
* fix scale step crashing bug * cleanup fixes * cleanup
This commit is contained in:
parent
4dacce0682
commit
55d50a24e9
|
|
@ -17,7 +17,7 @@
|
||||||
role="button"
|
role="button"
|
||||||
@click="setScale(i)"
|
@click="setScale(i)"
|
||||||
>
|
>
|
||||||
{{ i }}
|
{{ parseFloat(i).toFixed(2) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -58,6 +58,10 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
scaleList() {
|
scaleList() {
|
||||||
const list = []
|
const list = []
|
||||||
|
if (this.stepScale == 0) {
|
||||||
|
list.push(this.minScale)
|
||||||
|
return list
|
||||||
|
}
|
||||||
for (let i = this.minScale; i <= this.maxScale; i += this.stepScale) {
|
for (let i = this.minScale; i <= this.maxScale; i += this.stepScale) {
|
||||||
list.push(i)
|
list.push(i)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@ export default {
|
||||||
} else if (field.type === 'scale') {
|
} else if (field.type === 'scale') {
|
||||||
inputProperties.minScale = parseInt(field.scale_min_value) ?? 1
|
inputProperties.minScale = parseInt(field.scale_min_value) ?? 1
|
||||||
inputProperties.maxScale = parseInt(field.scale_max_value) ?? 5
|
inputProperties.maxScale = parseInt(field.scale_max_value) ?? 5
|
||||||
inputProperties.stepScale = parseInt(field.scale_step_value) ?? 1
|
inputProperties.stepScale = parseFloat(field.scale_step_value) ?? 1
|
||||||
} else if (field.type === 'slider') {
|
} else if (field.type === 'slider') {
|
||||||
inputProperties.minSlider = parseInt(field.slider_min_value) ?? 0
|
inputProperties.minSlider = parseInt(field.slider_min_value) ?? 0
|
||||||
inputProperties.maxSlider = parseInt(field.slider_max_value) ?? 50
|
inputProperties.maxSlider = parseInt(field.slider_max_value) ?? 50
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue