'Vue pass data into array specific item name

Hey I am really new to Vue and for this project I was trying to add data inside array using .push() . When I push data inside totalPlayers its suppose to get data as totalPlayers[{data:[0,1,2,3]}] but it currently saves data as totalPlayers[{data: [] }, 0, 1, 2, 3]. Is there a way to fix this? Here is my code below

JsFiddle = https://jsfiddle.net/ujjumaki/xv2homt8/24/

Method

new Vue({
  el: "#app",
  data: {
    totalPlayers:[{
     data:[],
    }],
    playerList:4,
  },
  methods: {
    buttonClicked(){
        for (var i = 0; i < this.playerList; i++) {
        console.log('i was '+i);
        this.totalPlayers.push(i);
        console.log(this.totalPlayers);
      }
    }
  }
})

View

<div id="app">
  <button @click="buttonClicked()">
    Click Me
  </button>
</div>


Solution 1:[1]

Just use this to push: this.totalPlayers[0].data.push(i); since totalPlayers is an array and you want to add to it's first element that is an object jsfiddle

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gabriel