mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[napajanie modalov na BE]
This commit is contained in:
1 parent
26792a85a6
commit
4c8ee66cd6
34 files changed
+494
-396
No files matched your search
@@ -1,18 +1,18 @@
|
||||
<template>
|
||||
<v-dialog v-model="show" max-width="650">
|
||||
<v-dialog v-model="visible" max-width="650">
|
||||
<v-card>
|
||||
<div class="d-flex justify-space-between align-center">
|
||||
<h1>Ste si istý, že chcete ukončiť <b>{{ task.title }}</b>?</h1>
|
||||
|
||||
<v-icon
|
||||
@click.stop="show = false"
|
||||
@click.stop="visible = 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="complete()">ÁNO</v-btn>
|
||||
<v-btn class="ml-7 cancel-btn" @click.stop="show = false">ZRUŠIŤ</v-btn>
|
||||
<v-btn class="ml-7 cancel-btn" @click.stop="visible = false">ZRUŠIŤ</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
@@ -22,31 +22,19 @@
|
||||
export default {
|
||||
emits: ['close'],
|
||||
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
|
||||
task: {
|
||||
type: Object,
|
||||
required: true
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
task: null
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
show: {
|
||||
get() {
|
||||
return this.visible
|
||||
},
|
||||
|
||||
set(value) {
|
||||
if (!value) this.$emit('close')
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
async showModal(task) {
|
||||
this.task = task
|
||||
this.visible = true
|
||||
},
|
||||
|
||||
async complete() {
|
||||
try {
|
||||
const task = {
|
||||
@@ -55,7 +43,7 @@ export default {
|
||||
}
|
||||
|
||||
await this.$axios.post(`v1/tasks/${task.id}`, task)
|
||||
this.show = false
|
||||
this.visible = false
|
||||
this.$emit('completeTask', task.id)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
|
||||
Reference in new issue
Block a user