import { Dialog, ErrorMessage } from 'frappe-ui' import { reactive, ref } from 'vue' let dialogs = ref([]) export let Dialogs = { name: 'Dialogs', render() { return dialogs.value.map((dialog) => ( (dialog.show = val)} > {{ 'body-content': () => { return [ dialog.message && (

{dialog.message}

), dialog.html && (
), , ] }, }}
)) }, } export function createDialog(dialogOptions) { let dialog = reactive(dialogOptions) dialog.key = 'dialog-' + dialogs.value.length dialog.show = false setTimeout(() => { dialog.show = true }, 0) dialogs.value.push(dialog) }