I have a html form and based on the user input I want to give a total score of completion (e.g 80%). My plan is to do that with computed values that are watching seperate parts of the form and for the total score I want to sum them up like so:
simplified version of the vue file:
[..]
computed: {
Chk_input1: function(){
// Here will be a check if at least 4 characters in input field, if yes
return 30
},
Chk_input2: function(){
// Here will be a check if multiple conditions are met, if yes
return 30
},
Chk_input3: function(){
// Here will be a check if at least 4 characters in input field, if yes
return 26
},
total_score: function(Chk_input1, Chk_input2, Chk_input3){
// finally sum up the computed values input1 - input3
return Chk_input1 + Chk_input2 + Chk_input3
}
},
But the result is:
total_score = [object Object]undefinedundefined%
How do I sum up these values properly?