截图模块调整
This commit is contained in:
+10
-1
@@ -18,7 +18,6 @@ window.addEventListener('unhandledrejection', (event) => {
|
||||
// ===== OSD 窗口模式检测 =====
|
||||
// 通过 URL hash 识别独立窗口:#osd-overlay / #clipboard-popup / #tray-menu / #screenshot-overlay / #screenshot-editor
|
||||
// 这些窗口是精简的独立 Vue 应用,不加载主应用的 store 和模块
|
||||
// 注意:screenshot-overlay 带 query(?mode=region),用 startsWith 匹配
|
||||
const winHash = window.location.hash
|
||||
if (winHash === '#osd-overlay') {
|
||||
logger.info(`OSD 窗口启动: ${winHash}`)
|
||||
@@ -84,6 +83,16 @@ if (winHash === '#osd-overlay') {
|
||||
void import('./stores/processStore').then(({ useProcessStore }) => {
|
||||
useProcessStore().initListener().catch(e => console.error('Process listener init error:', e))
|
||||
})
|
||||
|
||||
// 截图模块:加载设置 + 预创建常驻覆盖层窗口 + 监听导出事件(历史/自动保存)+ 注册并监听全局快捷键
|
||||
void import('./stores/screenshotStore').then(({ useScreenshotStore }) => {
|
||||
const screenshotStore = useScreenshotStore()
|
||||
screenshotStore.loadSettings()
|
||||
screenshotStore.initOverlay().catch(e => console.error('Screenshot overlay init error:', e))
|
||||
screenshotStore.initExportListener().catch(e => console.error('Screenshot export listener init error:', e))
|
||||
screenshotStore.initShortcutListener().catch(e => console.error('Screenshot shortcut listener init error:', e))
|
||||
screenshotStore.initShortcutRegistration().catch(e => console.error('Screenshot shortcut registration init error:', e))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user