api-client/components/smart/ConfirmModal.vue

55 lines
1 KiB
Vue
Raw Normal View History

<template>
2021-08-26 05:14:01 +00:00
<SmartModal
v-if="show"
dialog
:title="$t('modal.confirm')"
@close="hideModal"
>
<template #body>
2021-07-17 17:40:28 +00:00
<div class="flex flex-col px-2">
<label>
2021-07-09 17:19:45 +00:00
{{ title }}
</label>
</div>
</template>
<template #footer>
<span>
<ButtonPrimary v-focus :label="yes" @click.native="resolve" />
2021-07-09 17:19:45 +00:00
<ButtonSecondary :label="no" @click.native="hideModal" />
</span>
</template>
</SmartModal>
</template>
<script>
2021-08-24 03:44:46 +00:00
import { defineComponent } from "@nuxtjs/composition-api"
export default defineComponent({
props: {
show: Boolean,
2021-05-18 16:09:55 +00:00
title: { type: String, default: null },
yes: {
type: String,
2021-05-18 09:27:29 +00:00
default() {
return this.$t("action.yes")
},
},
no: {
type: String,
2021-05-18 09:27:29 +00:00
default() {
return this.$t("action.no")
},
},
},
methods: {
hideModal() {
this.$emit("hide-modal")
},
resolve() {
this.$emit("resolve")
2021-07-07 23:28:42 +00:00
this.$emit("hide-modal")
},
},
2021-08-24 03:44:46 +00:00
})
</script>