refactor(command): use dialog (#352)
This commit is contained in:
parent
f249087a95
commit
462e85dad0
7 changed files with 110 additions and 131 deletions
|
@ -8,6 +8,8 @@ export const mediaPreviewIndex = ref(0)
|
|||
export const statusEdit = ref<StatusEdit>()
|
||||
export const dialogDraftKey = ref<string>()
|
||||
|
||||
export const commandPanelInput = ref('')
|
||||
|
||||
export const isFirstVisit = useLocalStorage(STORAGE_KEY_FIRST_VISIT, !process.mock)
|
||||
export const isZenMode = useLocalStorage(STORAGE_KEY_ZEN_MODE, false)
|
||||
|
||||
|
@ -16,6 +18,7 @@ export const isPublishDialogOpen = ref(false)
|
|||
export const isMediaPreviewOpen = ref(false)
|
||||
export const isEditHistoryDialogOpen = ref(false)
|
||||
export const isPreviewHelpOpen = ref(isFirstVisit.value)
|
||||
export const isCommandPanelOpen = ref(false)
|
||||
|
||||
export const toggleZenMode = useToggle(isZenMode)
|
||||
|
||||
|
@ -72,3 +75,12 @@ export function openPreviewHelp() {
|
|||
export function closePreviewHelp() {
|
||||
isPreviewHelpOpen.value = false
|
||||
}
|
||||
|
||||
export function openCommandPanel(isCommandMode = false) {
|
||||
commandPanelInput.value = isCommandMode ? '>' : ''
|
||||
isCommandPanelOpen.value = true
|
||||
}
|
||||
|
||||
export function closeCommandPanel() {
|
||||
isCommandPanelOpen.value = false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue