diff --git a/js/gamutable.es6.js b/js/gamutable.es6.js index a6e4b45..0211966 100644 --- a/js/gamutable.es6.js +++ b/js/gamutable.es6.js @@ -234,6 +234,7 @@ let monTableau = { return this.apiuri.match(/.*page=(.*)/)[1]; }, chargerJson(id) { + console.log('chargerJson'); let url = this.apiuri; if (parseInt(id) > 0) { url += '&id=' + id; @@ -270,7 +271,10 @@ let monTableau = { if (parseInt(id) > 0) { if (data.length > 0) { let i = this.table.findIndex((ligne) => ligne.html.id === parseInt(id)); - Vue.set(this.table, i, data[0]); + //Vue.set(this.table, i, data[0]); + //console.log(this.table[245]); + this.table[i] = data[0]; + //console.log(this.table[245]); } else { let i = this.table.findIndex((ligne) => ligne.html.id === parseInt(id)); Vue.delete(this.table, i); @@ -443,9 +447,11 @@ const gamuTable = { components: { monTableau }, methods: { rechargerJson(id) { + console.log('coucou'); + console.log(id); this.$refs.montableau.chargerJson(id); }, }, }; -Vue.createApp(gamuTable).mount('#app'); +let app = Vue.createApp(gamuTable).mount('#app'); diff --git a/js/gamutable.js b/js/gamutable.js index c469180..3a42779 100644 --- a/js/gamutable.js +++ b/js/gamutable.js @@ -277,6 +277,7 @@ var monTableau = { chargerJson: function chargerJson(id) { var _this2 = this; + console.log('chargerJson'); var url = this.apiuri; if (parseInt(id) > 0) { @@ -325,9 +326,11 @@ var monTableau = { if (data.length > 0) { var i = _this2.table.findIndex(function (ligne) { return ligne.html.id === parseInt(id); - }); + }); //Vue.set(this.table, i, data[0]); + //console.log(this.table[245]); - Vue.set(_this2.table, i, data[0]); + + _this2.table[i] = data[0]; //console.log(this.table[245]); } else { var _i2 = _this2.table.findIndex(function (ligne) { return ligne.html.id === parseInt(id); @@ -459,8 +462,10 @@ var gamuTable = { }, methods: { rechargerJson: function rechargerJson(id) { + console.log('coucou'); + console.log(id); this.$refs.montableau.chargerJson(id); } } }; -Vue.createApp(gamuTable).mount('#app'); \ No newline at end of file +var app = Vue.createApp(gamuTable).mount('#app'); \ No newline at end of file