import Vue from 'vue' import VueResource from 'vue-resource' Vue.use(VueResource); export default { template: '#vue-usagers', delimiters: ['${', '}'], data () { return { persons_associated: [] }; }, http: { root: 'http://localhost:8001/fr/api' }, methods: { addPerson(){ this.persons_associated.persons.push({"firstname": "Lisa", "lastname": "Simpson", "startdate": "1975-09-15", "enddate": "2021-04-20" }) } }, computed: { counter() { return this.persons_associated.persons.length; } }, created() { this.$resource('parcours/861/show').get().then((response) => { this.persons_associated = response.data }, (response) => { console.log('erreur', response); }); } };