Files
sapper/test/app/routes/delete-test.html
2018-01-13 23:29:16 -05:00

15 lines
262 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>