19 lines
299 B
TypeScript
19 lines
299 B
TypeScript
import { defineStore } from 'pinia';
|
|
|
|
export const useMsg = defineStore('msg', {
|
|
state: () => ({
|
|
msgArray: [] as any[],
|
|
}),
|
|
actions: {
|
|
getAllMsg() {
|
|
return this.msgArray;
|
|
},
|
|
setMsg(value: Object) {
|
|
this.msgArray.push(value);
|
|
},
|
|
removeAll() {
|
|
this.msgArray = [];
|
|
},
|
|
},
|
|
});
|