[Modals] Refactoring

This commit is contained in:
Matej Glasnák committed 2022-12-06 19:08:06 +01:00
1 parent 707526fb2d
commit e1d9e6302f
18 files changed
+292 -465

No files matched your search

@@ -0,0 +1,59 @@
<template>
<v-dialog v-model="show" max-width="650">
<v-card>
<div class="d-flex justify-space-between align-center">
<h1>Ste si istý, že chcete zmazať tím <b>{{ team.name }}</b>?</h1>
<v-icon
@click.stop="show = false"
icon="mdi-close"
size="large"
></v-icon>
</div>
<v-card-actions class="mt-10 d-flex justify-start align-center">
<v-btn class="z-btn" variant="flat" @click="deleteTeam()">ÁNO</v-btn>
<v-btn class="ml-7 cancel-btn" @click.stop="show = false">ZRUŠIŤ</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
export default {
emits: ['delete-team', 'close'],
props: {
visible: {
type: Boolean,
required: true
},
team: {
type: Object,
required: true
}
},
methods: {
async deleteTeam() {
try {
await this.$axios.delete(`v1/teams/${this.team.id}`)
this.show = false
} catch (error) {
this.$toast.error(error)
}
}
},
computed: {
show: {
get() {
return this.visible
},
set(value) {
if (!value) this.$emit('close')
}
},
}
}
</script>