docs: 将仓库代码注释统一为中文
This commit is contained in:
@@ -2,7 +2,7 @@ import { nextTick, onBeforeUnmount, shallowRef } from 'vue'
|
||||
|
||||
export interface ActionDialogRequest { message: string; mode: 'confirm' | 'prompt'; initialValue: string }
|
||||
|
||||
/** Requests belong to the invoking view; leaving it cancels pending work. */
|
||||
/** 请求属于调用视图;离开它会取消待处理的工作。 */
|
||||
export function useActionDialog() {
|
||||
const actionDialog = shallowRef<ActionDialogRequest | null>(null)
|
||||
let pending: ((value: string | null) => void) | undefined
|
||||
@@ -11,7 +11,7 @@ export function useActionDialog() {
|
||||
const resolve = pending
|
||||
pending = undefined
|
||||
actionDialog.value = null
|
||||
await nextTick() // Restore focus and release the modal before the caller continues.
|
||||
await nextTick() // 在调用者继续之前恢复焦点并释放模式。
|
||||
resolve?.(disposed ? null : value)
|
||||
}
|
||||
function request(mode: ActionDialogRequest['mode'], message: string, initialValue = '') {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { onMounted, onUnmounted } from 'vue'
|
||||
import { useWorkspaceStore } from '@/stores/workspace'
|
||||
import { useEditorStore } from '@/stores/editor'
|
||||
|
||||
/** Web fallback until the desktop host supplies filesystem events. No overlapping polls. */
|
||||
/** Web 回退,直到桌面主机提供文件系统事件。没有重叠的民意调查。 */
|
||||
export function useWorkspaceRefresh() {
|
||||
const workspace = useWorkspaceStore()
|
||||
const editor = useEditorStore()
|
||||
@@ -21,7 +21,7 @@ export function useWorkspaceRefresh() {
|
||||
else await editor.checkExternalFile()
|
||||
}
|
||||
}
|
||||
} catch { /* Keep the existing tree; the store exposes the error and retries. */ }
|
||||
} catch { /* 保留现有树;商店暴露错误并重试。 */ }
|
||||
finally {
|
||||
running = false
|
||||
if (!stopped) timer = setTimeout(refresh, 2000)
|
||||
|
||||
Reference in New Issue
Block a user