feat: add introduce

This commit is contained in:
Anthony Fu 2022-11-24 10:38:14 +08:00
parent 521ad7a332
commit 4885b165df
6 changed files with 87 additions and 1 deletions

View file

@ -1,5 +1,10 @@
import { STORAGE_KEY_FIRST_VISIT } from '~/constants'
export const isFirstVisit = useLocalStorage(STORAGE_KEY_FIRST_VISIT, true)
export const isUserSwitcherOpen = ref(false)
export const isSigninDialogOpen = ref(false)
export const isPreviewHelpOpen = ref(isFirstVisit.value)
export function openUserSwitcher() {
isUserSwitcherOpen.value = true
@ -9,3 +14,13 @@ export function openSigninDialog() {
isSigninDialogOpen.value = true
isUserSwitcherOpen.value = false
}
export function openPreviewHelp() {
isPreviewHelpOpen.value = true
}
if (isPreviewHelpOpen.value) {
watch(isPreviewHelpOpen, () => {
isFirstVisit.value = false
})
}