[Vuejs]-How to bind the input field with vuejs by using template

0👍

  1. Your defined data does not contain price and quantity
new Vue({
    el:'body',
    data:{
        message:'Hello world ',
      price: 0,
      quantity: 0
    },
  //...
}  
  1. If you want value changes from the component’s props to sync to the parent instance’s data, you have to use the .sync modifier
<form >
    <input_box label="quantity" name.sync="quantity" ></input_box>
    <input_box label="price" name.sync="price" ></input_box>
  {{totalprice}}
</form>

Leave a comment