Files
sapper/test/app/routes/delete-test.html
2018-03-17 11:55:02 -04:00

15 lines
261 B
HTML

<button class='del' on:click='del()'>delete</button>
<script>
export default {
methods: {
del() {
fetch(`api/delete/42`, { method: 'DELETE' })
.then(r => r.json())
.then(data => {
window.deleted = data;
});
}
}
};
</script>