Skip to content

Commit 4c12943

Browse files
committed
update 恢复误删文件
1 parent 25189f3 commit 4c12943

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/hooks/useDialog.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Ref } from 'vue';
2+
3+
interface Options {
4+
title?: string;
5+
}
6+
interface Return {
7+
title: Ref<string>;
8+
visible: Ref<boolean>;
9+
openDialog: () => void;
10+
closeDialog: () => void;
11+
}
12+
export default (ops?: Options): Return => {
13+
const visible = ref(false);
14+
const title = ref(ops.title || '');
15+
16+
const openDialog = () => {
17+
visible.value = true;
18+
};
19+
20+
const closeDialog = () => {
21+
visible.value = false;
22+
};
23+
24+
return {
25+
title,
26+
visible,
27+
28+
openDialog,
29+
closeDialog
30+
};
31+
};

0 commit comments

Comments
 (0)