2021-10-15 18:45:41 +00:00
|
|
|
<template>
|
|
|
|
<div class="collect-quote__container">
|
|
|
|
<div class="collect-quote__quote">
|
|
|
|
{{ quote.quote }}
|
|
|
|
{{ quote.quote }}
|
|
|
|
</div>
|
|
|
|
<div class="collect-quote__actions">
|
|
|
|
<div class="collect-quote__icon collect-quote__icon-edit" @click="edit" />
|
|
|
|
<div class="collect-quote__icon collect-quote__icon-delete" @click="remove" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: ['quote'],
|
|
|
|
methods: {
|
2021-10-16 19:35:31 +00:00
|
|
|
async edit() {
|
|
|
|
await this.save()
|
2021-10-15 21:07:41 +00:00
|
|
|
},
|
2021-10-16 19:35:31 +00:00
|
|
|
async save() {
|
2021-10-16 19:47:45 +00:00
|
|
|
// this.$engine.createQuote(this.quote.quote)
|
|
|
|
this.$engine.saveQuote(this.quote.id, this.quote.quote)
|
2021-10-16 19:35:31 +00:00
|
|
|
await this.$engine.getMyQuotes()
|
2021-10-15 18:45:41 +00:00
|
|
|
},
|
2021-10-16 19:35:31 +00:00
|
|
|
async remove() {
|
|
|
|
if (confirm('Eintrag wirklich löschen?')) {
|
|
|
|
this.$engine.removeQuote(this.quote.id)
|
|
|
|
await this.$engine.getMyQuotes()
|
|
|
|
}
|
2021-10-15 18:45:41 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.collect-quote {
|
|
|
|
&__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;
|
2021-10-15 21:07:41 +00:00
|
|
|
cursor: pointer;
|
2021-10-15 18:45:41 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: #6040c0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-edit::after {
|
|
|
|
content: '✎';
|
|
|
|
}
|
|
|
|
&-delete::after {
|
|
|
|
content: '🗑';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|