From 74943c3d2b2894406084ff601780a8523b59f555 Mon Sep 17 00:00:00 2001 From: zxc <1171051090@qq.com> Date: Sat, 15 Mar 2025 16:47:21 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AF=BC=E5=87=BAJSON=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8C=85=E5=90=AB=E4=B8=BB=E9=A2=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_zh.md | 3 +-- src/hooks/useExport.ts | 1 + src/views/Editor/ExportDialog/ExportJSON.vue | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README_zh.md b/README_zh.md index 4f998955..eb00bbdc 100644 --- a/README_zh.md +++ b/README_zh.md @@ -16,8 +16,7 @@ 1. 本项目是一个 “Web 幻灯片应用” ,而不是 “低代码平台”、“H5 编辑器”、“图片编辑器” 、“白板应用”等。 2. 本项目的目标受众是有【Web 幻灯片】开发需求的开发者,提供的链接只是一个演示地址,不提供任何在线服务。你不应该直接将本项目作为工具使用,也不支持开箱即用。 如果你只是需要一个服务或工具,可以选择更优秀和成熟的产品,例如:[Slidev](https://sli.dev/)、[revealjs](https://revealjs.com/) 等。 -3. 本项目是基于 DOM 的渲染方案,优点是上手简单易扩展。但是相比 Canvas 渲染的方案,在极端复杂场景下性能会存在一定的差距,所以如果你对性能有较高的要求,本项目可能不是一个好的选择/参考方向。 -4. 这里总结了一些[常见问题](/doc/Q&A.md),第一次提 Issues 和 PR 时,务必提前阅读此文档。 +3. 这里总结了一些[常见问题](/doc/Q&A.md),第一次提 Issues 和 PR 时,务必提前阅读此文档。 # 🚀 项目运行 diff --git a/src/hooks/useExport.ts b/src/hooks/useExport.ts index bac8adee..e1efe735 100644 --- a/src/hooks/useExport.ts +++ b/src/hooks/useExport.ts @@ -73,6 +73,7 @@ export default () => { title: title.value, width: viewportSize.value, height: viewportSize.value * viewportRatio.value, + theme: theme.value, slides: slides.value, } const blob = new Blob([JSON.stringify(json)], { type: '' }) diff --git a/src/views/Editor/ExportDialog/ExportJSON.vue b/src/views/Editor/ExportDialog/ExportJSON.vue index 0607fab3..bdda8921 100644 --- a/src/views/Editor/ExportDialog/ExportJSON.vue +++ b/src/views/Editor/ExportDialog/ExportJSON.vue @@ -22,7 +22,7 @@ const emit = defineEmits<{ (event: 'close'): void }>() -const { slides, viewportRatio, title, viewportSize } = storeToRefs(useSlidesStore()) +const { slides, viewportRatio, title, viewportSize, theme } = storeToRefs(useSlidesStore()) const { exportJSON } = useExport() const json = computed(() => { @@ -30,6 +30,7 @@ const json = computed(() => { title: title.value, width: viewportSize.value, height: viewportSize.value * viewportRatio.value, + theme: theme.value, slides: slides.value, } })