0

I have an array object like this:

0:{total_electricity_generated: 1567.7910000000002}
1:{total_electricity_generated: 1468.4869999999999}
2:{total_electricity_generated: 498.7319999999999}
3:{total_electricity_generated: 461.8369999999999}

Is there any way to append data in existing row In vuejs 2?

0:{total_electricity_generated: 1567.7910000000002, anotherValue: 1}
1:{total_electricity_generated: 1468.4869999999999, anotherValue: 2}
2:{total_electricity_generated: 498.7319999999999, anotherValue: 3}
3:{total_electricity_generated: 461.8369999999999, anotherValue: 4}

1 Answer 1

1

Try it like this

const vApp = new Vue({
    el:'#app',
    data: { 
        test: [{
             entry: 'first'
          }] 
   }
})

vApp.test[0].anotherValue = 1
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.