mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-09 08:48:21 +08:00
fix(config): appStore新增devPath用于dev页面文件写入,调整config页面样式
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-card style="margin-bottom: 10px">
|
||||
<v-card-title>配置</v-card-title>
|
||||
</v-card>
|
||||
<v-card style="margin-bottom: 10px">
|
||||
<v-list>
|
||||
<v-list-item @click="openMergeData" prepend-icon="mdi-folder">
|
||||
<v-list-item-title>打开用户数据目录</v-list-item-title>
|
||||
@@ -13,6 +15,18 @@
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-card>
|
||||
<v-card style="margin-bottom: 10px">
|
||||
<v-list>
|
||||
<v-list-item prepend-icon="mdi-folder">
|
||||
<v-list-item-title>本地应用数据路径</v-list-item-title>
|
||||
<v-list-item-subtitle>{{ appStore.devPath.app }}</v-list-item-subtitle>
|
||||
</v-list-item>
|
||||
<v-list-item prepend-icon="mdi-folder">
|
||||
<v-list-item-title>本地用户数据路径</v-list-item-title>
|
||||
<v-list-item-subtitle>{{ appStore.devPath.merge }}</v-list-item-subtitle>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
@@ -14,6 +14,8 @@ const appDataDir = `${await path.appLocalDataDir()}appData`;
|
||||
const userDataDir = `${await path.appLocalDataDir()}userData`;
|
||||
// 用于存储合并数据的路径-列表渲染时使用,减少重复计算
|
||||
const mergeDataDir = `${await path.appLocalDataDir()}mergeData`;
|
||||
// 用于开发者模式的路径
|
||||
const devDataDir = `${await path.resolve("../")}\\src\\data`;
|
||||
|
||||
const useAppStore = defineStore({
|
||||
id: "app",
|
||||
@@ -30,6 +32,7 @@ const useAppStore = defineStore({
|
||||
app: appDataDir,
|
||||
user: userDataDir,
|
||||
merge: mergeDataDir,
|
||||
dev: devDataDir,
|
||||
},
|
||||
// 应用数据路径
|
||||
appPath: {
|
||||
@@ -45,6 +48,11 @@ const useAppStore = defineStore({
|
||||
achievements: `${mergeDataDir}\\achievements.json`,
|
||||
achievementSeries: `${mergeDataDir}\\achievementSeries.json`,
|
||||
},
|
||||
// 开发者模式
|
||||
devPath: {
|
||||
app: `${devDataDir}\\app`,
|
||||
merge: `${devDataDir}\\merge`,
|
||||
},
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
@@ -61,6 +69,7 @@ const useAppStore = defineStore({
|
||||
app: appDataDir,
|
||||
user: userDataDir,
|
||||
merge: mergeDataDir,
|
||||
dev: devDataDir,
|
||||
};
|
||||
// 初始化应用数据路径
|
||||
this.appPath = {
|
||||
@@ -76,6 +85,11 @@ const useAppStore = defineStore({
|
||||
achievements: `${mergeDataDir}\\achievements.json`,
|
||||
achievementSeries: `${mergeDataDir}\\achievementSeries.json`,
|
||||
};
|
||||
// 初始化开发者模式
|
||||
this.devPath = {
|
||||
app: `${devDataDir}\\app`,
|
||||
merge: `${devDataDir}\\merge`,
|
||||
};
|
||||
},
|
||||
},
|
||||
persist: true,
|
||||
|
||||
Reference in New Issue
Block a user