parsley/app/javascript/components/AppConfirm.vue

43 lines
707 B
Vue
Raw Normal View History

2018-05-01 10:55:57 -05:00
<template>
<app-modal :open="open" :title="message" @dismiss="runCancel">
<div class="buttons">
<button type="button" class="button is-primary" @click="runConfirm">OK</button>
<button type="button" class="button" @click="runCancel">Cancel</button>
</div>
</app-modal>
</template>
2024-09-29 13:35:49 -05:00
<script setup>
const props = defineProps({
cancel: {
type: Function,
required: true
},
confirm: {
type: Function,
required: true
},
message: {
type: String,
required: false,
default: 'Are you sure?'
},
open: {
type: Boolean,
required: true
2018-05-01 10:55:57 -05:00
}
2024-09-29 13:35:49 -05:00
});
function runConfirm() {
props.confirm();
}
function runCancel() {
props.cancel();
}
2018-05-01 10:55:57 -05:00
</script>