mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
20 lines
497 B
TypeScript
20 lines
497 B
TypeScript
import type { Component } from "vue";
|
|
|
|
|
|
const showDialog = ref<boolean>(false);
|
|
const dialogParams = ref<any>({});
|
|
const dialogComponent = ref<Component>();
|
|
|
|
function closeDialog() {
|
|
showDialog.value = false;
|
|
}
|
|
|
|
function openDialog(component: Component, params: any) {
|
|
dialogComponent.value = component;
|
|
dialogParams.value = params;
|
|
showDialog.value = true;
|
|
}
|
|
|
|
export function useCustomDialog() {
|
|
return { showDialog, closeDialog, openDialog, dialogParams, dialogComponent };
|
|
} |