Whenever I add a value to my array using VueJS, Chrome initially displays it but then immediately reloads the webpage.
let vm = new Vue ({
el:'#app2',
data: {
people: ['Robert', 'Pablo', 'Lucas', 'Teban']
},
methods: {
addPerson: function() {
this.people.push('Maxime')
},
}
})
<section id="app2" style="margin-top: 100px">
<p>{{people}}</p>
<form>
<button v-on:click='addPerson'>Ajouter une personne</button>
</form>
</section>