Skip to content

Commit

Permalink
types: 隐藏无须处理的 ts 报错
Browse files Browse the repository at this point in the history
  • Loading branch information
pany-ang committed Dec 12, 2023
1 parent aa98712 commit 03928df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/store/modules/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const useSettingsStore = defineStore("settings", () => {
for (const [key, value] of Object.entries(layoutSettings)) {
// 使用类型断言来指定 key 的类型,将 value 包装在 ref 函数中,创建一个响应式变量
const refValue = ref(value)
// @ts-ignore
state[key as SettingsStoreKey] = refValue
// 监听每个响应式变量
watch(refValue, () => {
Expand Down

0 comments on commit 03928df

Please sign in to comment.