fix:修复浅拷贝数组问题
This commit is contained in:
@@ -98,16 +98,20 @@ const defaultAvatarConfig = {
|
||||
option: '0',
|
||||
}
|
||||
|
||||
const defaultOathConfig = {
|
||||
const createDefaultOathConfig = (): IConfigOath => ({
|
||||
id: '',
|
||||
adaptation: 0,
|
||||
upgrade: [0, 0, 0, 0],
|
||||
}
|
||||
})
|
||||
|
||||
const defaultEmblemConfig = {
|
||||
const defaultOathConfig = createDefaultOathConfig()
|
||||
|
||||
const createDefaultEmblemConfig = (): IConfigEmblem => ({
|
||||
lv: 0,
|
||||
items: ['', '', '', '', '', ''],
|
||||
}
|
||||
})
|
||||
|
||||
const defaultEmblemConfig = createDefaultEmblemConfig()
|
||||
|
||||
export const useConfigStore = defineStore('configStore', () => {
|
||||
const config = ref<IConfig>({
|
||||
@@ -194,7 +198,7 @@ export const useConfigStore = defineStore('configStore', () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
config.value &&
|
||||
!config.value?.oaths.hasOwnProperty(p) &&
|
||||
(config.value.oaths[p.toString()] = { ...defaultOathConfig })
|
||||
(config.value.oaths[p.toString()] = createDefaultOathConfig())
|
||||
})
|
||||
|
||||
infoStore.options.forEach((option) => {
|
||||
@@ -284,6 +288,8 @@ export const useConfigStore = defineStore('configStore', () => {
|
||||
defaultEqusConfig,
|
||||
defaultAvatarConfig,
|
||||
defaultOathConfig,
|
||||
createDefaultOathConfig,
|
||||
defaultEmblemConfig,
|
||||
createDefaultEmblemConfig,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user