S
S
semki0962019-10-02 13:39:52
Vue.js
semki096, 2019-10-02 13:39:52

How to add the value of 2 form fields in vue.js?

There is a form, it has 3 fields: length, height, area. That is, I multiply one by the other and calculate the third, with this order.

data: {
      width: '500',
      height: '500',
      },
    computed: {
      summa:  function() { 
                          return this.width * this.height
        }
     ......

Visually everything works and counts. But the problem is that when submitting this form, the amount field does not have the desired value, and when viewed in the firebug, the value attribute for this field is missing. Help me decide, I would be grateful. From the docks, I realized that I need to add a setter, but I did not understand how it works.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question