24 lines
485 B
TypeScript
24 lines
485 B
TypeScript
|
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;
|
||
|
},
|
||
|
},
|
||
|
});
|