feat(tauri): 完成桌面端迁移(原生另存为 + plugin-http 取图 + 插件静态化 + 中文注释)
This commit is contained in:
1 parent
4709ec05f2
commit
cddbd1f8eb
72 files changed
+16317
-56
No files matched your search
@@ -2165,9 +2165,16 @@
|
||||
edges: refs.edges.slice(), groups: refs.groups.map((g) => ({ ...g, memberIds: g.memberIds.slice() })),
|
||||
}
|
||||
try {
|
||||
const blob = new Blob([JSON.stringify(data, null, 1)], { type: 'application/json' }); const a = document.createElement('a')
|
||||
a.href = URL.createObjectURL(blob); a.download = safeName.replace(/\.iwb\.json$/i, '') + '.iwb.json'; document.body.appendChild(a); a.click(); document.body.removeChild(a)
|
||||
setTimeout(() => URL.revokeObjectURL(a.href), 5000); setNotice({ type: 'ok', text: '已导出画布:' + a.download })
|
||||
const blob = new Blob([JSON.stringify(data, null, 1)], { type: 'application/json' })
|
||||
const outName = safeName.replace(/\.iwb\.json$/i, '') + '.iwb.json'
|
||||
// 统一出口:桌面端弹系统另存为(原生),网页端仍走 <a download>
|
||||
if (typeof window !== 'undefined' && window.__IWB_SAVE_BLOB__) window.__IWB_SAVE_BLOB__(blob, outName)
|
||||
else {
|
||||
const a = document.createElement('a')
|
||||
a.href = URL.createObjectURL(blob); a.download = outName; document.body.appendChild(a); a.click(); document.body.removeChild(a)
|
||||
setTimeout(() => URL.revokeObjectURL(a.href), 5000)
|
||||
}
|
||||
setNotice({ type: 'ok', text: '已导出画布:' + outName })
|
||||
} catch (e) { setNotice({ type: 'err', text: '导出失败:' + String((e && e.message) || e) }) }
|
||||
} })
|
||||
return { exportCanvas } // 包装方按对象取用
|
||||
|
||||
Reference in new issue
Block a user