Skip to content

Instantly share code, notes, and snippets.

@ShariqT
Created December 7, 2021 00:01
Show Gist options
  • Save ShariqT/4582a57f60761e9ab0f3adfdb4664c2f to your computer and use it in GitHub Desktop.
Save ShariqT/4582a57f60761e9ab0f3adfdb4664c2f to your computer and use it in GitHub Desktop.
list-postcards4.vue
<template>
<!-- other code -->
<ul>
<li v-for="postcard in postcards">
<span v-if="postcard.from != null">
From {{ postcard.from.name }} to {{ postcard.to.name }}.
</span>
<span v-else>
From *Address Missing* to {{ postcard.to.name }}.
</span>
<span
v-if="canCancel(postcard.send_date)"
@click="cancel(postcard.id)"
class="cancel">Cancel
</span>
</li>
</ul>
<!-- other code -->
</template>
<style>
.cancel {
cursor: pointer;
border: 1px solid red;
color: red;
border-radius: 10px;
padding: 6px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment