2022-12-03 07:24:51 +00:00
|
|
|
<template>
|
|
|
|
<b-modal
|
|
|
|
ref="removeTradeModal"
|
|
|
|
v-model="showRef"
|
|
|
|
:title="title"
|
|
|
|
@ok="msgBoxOK"
|
|
|
|
@cancel="showRef = false"
|
2023-10-21 15:29:14 +00:00
|
|
|
@keyup.esc="showRef = false"
|
|
|
|
@keyup.enter="msgBoxOK"
|
2022-12-03 07:24:51 +00:00
|
|
|
>
|
|
|
|
{{ message }}
|
|
|
|
</b-modal>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { ref } from 'vue';
|
|
|
|
|
|
|
|
export interface MsgBoxObject {
|
|
|
|
title: string;
|
|
|
|
message: string;
|
|
|
|
accept: () => void;
|
|
|
|
}
|
|
|
|
const showRef = ref<boolean>(false);
|
|
|
|
const title = ref<string>('');
|
|
|
|
const message = ref<string>('');
|
|
|
|
const accept = ref<() => void>(() => {
|
|
|
|
console.warn('Accepted not set.');
|
|
|
|
});
|
|
|
|
|
|
|
|
const msgBoxOK = () => {
|
|
|
|
accept.value();
|
2023-10-21 15:29:14 +00:00
|
|
|
showRef.value = false;
|
2022-12-03 07:24:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const show = (msg: MsgBoxObject) => {
|
|
|
|
title.value = msg.title;
|
|
|
|
message.value = msg.message;
|
|
|
|
showRef.value = true;
|
|
|
|
accept.value = msg.accept;
|
|
|
|
};
|
|
|
|
|
|
|
|
defineExpose({ show });
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped></style>
|