-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kevinwong
committed
Jun 7, 2024
1 parent
449f15a
commit 3ed93de
Showing
8 changed files
with
123 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { version } from '../../package.json' | ||
|
||
/** | ||
* The key of the application. | ||
*/ | ||
export const APP_KEY = 'opuntia' | ||
|
||
/** | ||
* The version of the application. | ||
*/ | ||
export const APP_VERSION = version | ||
|
||
/** | ||
* The storage key of the application. | ||
*/ | ||
export const APP_STORAGE_KEY = `${APP_KEY}-v${APP_VERSION}-` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { computed } from 'vue' | ||
import { defineStore } from 'pinia' | ||
import { assign } from 'lodash-es' | ||
|
||
/** | ||
* Setting state | ||
*/ | ||
export interface SettingState { | ||
/** | ||
* Control whether to show the logo. | ||
*/ | ||
logo: boolean | ||
} | ||
|
||
/** | ||
* Setting store. | ||
*/ | ||
export const useSettingStore = defineStore('setting', () => { | ||
const setting = useStorage(`${APP_STORAGE_KEY}setting`, { | ||
logo: true, | ||
}) | ||
|
||
const showLogo = computed(() => setting.value.logo) | ||
|
||
function updateSetting(_setting: SettingState) { | ||
setting.value = assign(setting.value, _setting) | ||
} | ||
|
||
return { setting, showLogo, updateSetting } | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters