[Vuejs]-Adding object to array in Vue

0👍

You need to push an actual object, not a string.

addPokemon(){
        var name = document.getElementById('pokeName').value;
        var number = document.getElementById('pokeNum').value;
        var pokeSON = {name: name, number: number};

        this.pokemon.push(pokeSON);
    }

Leave a comment