File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
app/src/pages/_fixed_panel Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { Stage } from "../../core/stage/Stage";
99import { isExportPNGPanelOpenAtom } from "../../state" ;
1010import { cn } from "../../utils/cn" ;
1111import { PathString } from "../../utils/pathString" ;
12+ import { StageManager } from "../../core/stage/stageManager/StageManager" ;
1213
1314/**
1415 * 导出png的面板
@@ -112,6 +113,14 @@ export default function ExportPNGPanel() {
112113 < div className = "my-2 flex justify-center gap-2" >
113114 < Button
114115 onClick = { ( ) => {
116+ // 如果当前舞台没有内容,则不能渲染
117+ if ( StageManager . isEmpty ( ) ) {
118+ Dialog . show ( {
119+ title : "舞台没有内容" ,
120+ content : "请先添加内容到舞台" ,
121+ } ) ;
122+ return ;
123+ }
115124 // 先清空box内部的内容
116125 const exportPngImageBox = document . getElementById ( "export-png-image-box" ) ;
117126 if ( exportPngImageBox ) {
You can’t perform that action at this time.
0 commit comments