feat: 项目结构调整|新增依赖

This commit is contained in:
duanshuwen
2025-11-22 21:17:40 +08:00
parent 38b6a4b4a3
commit 6013c38fe7
40 changed files with 535 additions and 115 deletions

View File

@@ -0,0 +1,22 @@
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const doubleCount = computed(() => count.value * 2)
function increment() {
count.value++
}
function decrement() {
count.value--
}
function reset() {
count.value = 0
}
return { count, doubleCount, increment, decrement, reset }
})

View File

@@ -0,0 +1,25 @@
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) {
}
}
}
}
})