choice input datatype detection

This commit is contained in:
vabene1111 2023-12-02 21:13:14 +01:00
parent ecffe30062
commit 1758aebb73

View File

@ -25,6 +25,12 @@ export default {
}, },
mounted() { mounted() {
this.new_value = this.value this.new_value = this.value
if (this.new_value === "") { // if the selection is empty but the options are of type number, set to 0 instead of ""
if (typeof this.options[0]['value'] === 'number') {
this.new_value = 0
}
}
}, },
watch: { watch: {
new_value: function () { new_value: function () {