ff-admin/src/stores/modal.ts

24 lines
485 B
TypeScript
Raw Normal View History

2024-08-25 13:37:23 +02:00
import { defineStore } from "pinia";
export const useModalStore = defineStore("modal", {
state: () => {
return {
show: false,
component_ref: null as any,
data: null as any,
};
},
actions: {
openModal(component_ref: any, data?: any) {
this.component_ref = component_ref;
this.data = data;
this.show = true;
},
closeModal() {
this.component_ref = null;
this.data = null;
this.show = false;
},
},
});