From e8bbe0ac15b3d13e687054105de2b89974d2ba09 Mon Sep 17 00:00:00 2001 From: WeiHan <1844152414@qq.com> Date: 星期五, 24 一月 2025 15:10:25 +0800 Subject: [PATCH] update src/components/Process/approvalRecord.vue. --- src/hooks/useDialog.ts | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/src/hooks/useDialog.ts b/src/hooks/useDialog.ts new file mode 100644 index 0000000..547f199 --- /dev/null +++ b/src/hooks/useDialog.ts @@ -0,0 +1,31 @@ +import { Ref } from 'vue'; + +interface Options { + title?: string; +} +interface Return { + title: Ref<string>; + visible: Ref<boolean>; + openDialog: () => void; + closeDialog: () => void; +} +export default (ops?: Options): Return => { + const visible = ref(false); + const title = ref(ops.title || ''); + + const openDialog = () => { + visible.value = true; + }; + + const closeDialog = () => { + visible.value = false; + }; + + return { + title, + visible, + + openDialog, + closeDialog + }; +}; -- Gitblit v1.9.3