mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
35 lines
800 B
JavaScript
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);
|
|
});
|
|
}
|
|
};
|