2021-04-23 13:13:57 +02:00

35 lines
800 B
JavaScript

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);
});
}
};