28 lines
382 B
TypeScript
28 lines
382 B
TypeScript
|
|
// store/dialog.ts
|
||
|
|
|
||
|
|
import { reactive } from 'vue';
|
||
|
|
|
||
|
|
interface DialogState {
|
||
|
|
isOpen: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
const state: DialogState = reactive({
|
||
|
|
isOpen: false,
|
||
|
|
});
|
||
|
|
|
||
|
|
export const useDialogStore = () => {
|
||
|
|
const openDialog = () => {
|
||
|
|
state.isOpen = true;
|
||
|
|
};
|
||
|
|
|
||
|
|
const closeDialog = () => {
|
||
|
|
state.isOpen = false;
|
||
|
|
};
|
||
|
|
|
||
|
|
return {
|
||
|
|
state,
|
||
|
|
openDialog,
|
||
|
|
closeDialog,
|
||
|
|
};
|
||
|
|
};
|