2021-10-29 20:13:38 +00:00
|
|
|
<template>
|
|
|
|
<div class="quote-list-item__container">
|
|
|
|
<div class="quote-list-item__quote">
|
|
|
|
{{ quote.quote }}
|
|
|
|
</div>
|
|
|
|
<div class="quote-list-item__actions">
|
|
|
|
<div class="quote-list-item__icon quote-list-item__icon-edit" @click="edit" />
|
|
|
|
<div class="quote-list-item__icon quote-list-item__icon-delete" @click="remove" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: ['quote'],
|
|
|
|
methods: {
|
|
|
|
async edit() {
|
|
|
|
this.$nuxt.$emit('edit-quote', this.quote)
|
|
|
|
},
|
|
|
|
async remove() {
|
|
|
|
if (confirm('Eintrag wirklich löschen?')) {
|
|
|
|
this.$engine.removeQuote(this.quote.id)
|
|
|
|
await this.$engine.getMyQuotes()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
2021-11-28 16:24:22 +00:00
|
|
|
@import '~/assets/css/components';
|
|
|
|
|
2021-10-29 20:13:38 +00:00
|
|
|
.quote-list-item {
|
|
|
|
&__container {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
&__quote {
|
|
|
|
color: #ffffff;
|
|
|
|
}
|
|
|
|
&__actions {
|
|
|
|
display: flex;
|
|
|
|
margin: 0 32px;
|
|
|
|
}
|
|
|
|
&__icon {
|
|
|
|
width: 48px;
|
|
|
|
height: 48px;
|
|
|
|
margin-left: 16px;
|
|
|
|
border: 1px solid #ffffff;
|
|
|
|
border-radius: 8px;
|
|
|
|
text-align: center;
|
|
|
|
line-height: 48px;
|
|
|
|
font-size: 32px;
|
|
|
|
color: #ffffff;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&:hover {
|
2021-11-28 16:24:22 +00:00
|
|
|
background-color: $primary-box-color;
|
2021-10-29 20:13:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&-edit::after {
|
|
|
|
content: '✎';
|
|
|
|
}
|
|
|
|
&-delete::after {
|
|
|
|
content: '🗑';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|