| 1234567891011121314151617181920212223242526 |
- import { defineStore } from 'pinia'
- import { useIndexedDBStore } from './indexedDB'
- export const useMsgStore = defineStore('msg', {
- state: () => ({
- msgUuid: <string>'',
- messages: <any[]>[],
- pageInfoList: []
- }),
- actions: {
- addMsg(msg: any) {
- const { useStore } = useIndexedDBStore()
- useStore(this.msgUuid).add(msg)
- this.messages.push(msg)
- },
- addMsg1(msg: any) {
- this.messages.push(msg)
- },
- msgToDB(msg: any) {
- const { useStore } = useIndexedDBStore()
- useStore(this.msgUuid).add(msg)
- }
- }
- })
|