25 lines
527 B
TypeScript
25 lines
527 B
TypeScript
import { defineStore } from 'pinia'
|
|
import { isEqual } from 'lodash-es'
|
|
|
|
export const useSharedStore = defineStore('shared', {
|
|
state: () => ({
|
|
sharedData: {},
|
|
}),
|
|
|
|
actions: {
|
|
updateSharedData(data: any) {
|
|
this.sharedData = Object.assign(this.sharedData, data)
|
|
|
|
const cloneData = JSON.parse(JSON.stringify(this.sharedData))
|
|
|
|
if (!isEqual(this.sharedData, data)) {
|
|
// 同步状态到主进程
|
|
try {
|
|
|
|
} catch (error) {
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}) |