Skip to content

Instantly share code, notes, and snippets.

@jsdecena
Created August 31, 2019 04:40
Show Gist options
  • Save jsdecena/9b5a4cd6b616bc30c5e3a744a8bd498f to your computer and use it in GitHub Desktop.
Save jsdecena/9b5a4cd6b616bc30c5e3a744a8bd498f to your computer and use it in GitHub Desktop.
Delete a post
<table class="table table-striped table-sm">
<thead>
<tr>
<th>#</th>
<th>Title</th>
<th>Body</th>
<th></th>
</tr>
</thead>
<tbody>
<tr v-for="(post, i) in posts" :key="i">
<td>{{post.id}}</td>
<td>{{post.title}}</td>
<td>{{post.body}}</td>
<td><button v-on:click.prevent="onDelete(i)" class="btn btn-sm btn-danger">delete</button></td>
</tr>
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment