[Vuejs]-Vue computed function resulting in error when data added

0👍

It looks like an error with the return value of your component’s data function. You have the “sale” property set to an array of objects. It should just be an object.
Change this:

    data: function() {
      return {
        tip: 8.50,
        sale: [
            { price: '' },
            { desc: '' },
            { amount: '' }
        ]
      };
    }

To this:

    data: function() {
      return {
        tip: 8.50,
        sale: { 
            price: '',
            desc: '',
            amount: '' 
        }
      };
    }

Leave a comment