Skip to content

Commit

Permalink
chore: save setting in localStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Nov 22, 2023
1 parent eaf69a0 commit a55f0ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions website/composables/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const loading = ref<'load' | 'parse' | false>(false)
export const code = ref('')
export const ast = shallowRef<unknown>({})
export const error = shallowRef<unknown>()
export const parseTime = ref(0)

export interface Options {
/** 解密函数调用次数 */
Expand Down Expand Up @@ -60,9 +61,7 @@ const defaultOptions: Options = {
isMinifiedEnable: false,
}

export const options = ref<Options>(defaultOptions)

export const parseTime = ref(0)
export const options = useLocalStorage<Options>(`${PREFIX}options`, defaultOptions)

export const hideEmptyKeys = useLocalStorage(`${PREFIX}hide-empty-keys`, true)
export const hideLocationData = useLocalStorage(
Expand Down

0 comments on commit a55f0ed

Please sign in to comment.