Attention : tous les elements HTML doivent provenir de variables vuejs
Vous devez stocker votre tableau impérativement, pour cela 2 options :
- localstorage
- ajax
- Installer le serveur :
cd server
npm install
npm run server
- Lancer le serveur
cd server
npm run server
const apiUri = "http://localhost:3000/";
fetch(apiUri + 'todo/' + id, {
method: 'PATCH',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: data
});
fetch(apiUri + 'todo', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: data
});
fetch(apiUri + 'todo/' + id, {
method: "DELETE"
});