fix: Resolve the issue of possible abnormal text generated during page creation.

This commit is contained in:
LIlGG
2025-10-09 17:48:18 +08:00
parent a93a679c71
commit c5d47c680c
11 changed files with 404 additions and 54 deletions

View File

@@ -37,9 +37,9 @@ export class WebBuilderStore {
readonly editorStore: EditorStore;
// 是否显示 webBuilder
showWorkbench: WritableAtom<boolean> = import.meta.hot?.data.showWorkbench ?? atom(false);
showWorkbench: WritableAtom<boolean> = import.meta.hot?.data?.showWorkbench ?? atom(false);
// 当前 webBuilder 所在的视图
currentView: WritableAtom<WebBuilderViewType> = import.meta.hot?.data.currentView ?? atom('code');
currentView: WritableAtom<WebBuilderViewType> = import.meta.hot?.data?.currentView ?? atom('code');
constructor() {
this.previewsStore = new PreviewsStore();
@@ -47,7 +47,7 @@ export class WebBuilderStore {
this.chatStore = new ChatStore(this, this.pagesStore);
this.editorStore = new EditorStore(this.pagesStore);
if (import.meta.hot) {
if (import.meta.hot && import.meta.hot.data) {
import.meta.hot.data.showWorkbench = this.showWorkbench;
import.meta.hot.data.currentView = this.currentView;
}