qinyan 1 rok temu
rodzic
commit
3617f3ea61

+ 1 - 1
src/modules/editor/components/Viewport/Header/index.tsx

@@ -32,7 +32,7 @@ export default defineUI({
         </Radio.Group> */}
         <div class="absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2">
           <div class="text-16px font-bold text-light-50 max-w-240px truncate leading-normal">
-            {controls.pageCtrl.designData?.title}
+            {controls.pageCtrl.state.title}
           </div>
         </div>
         <aside class="space-x-12px">

+ 3 - 1
src/modules/editor/controllers/PageCtrl/index.ts

@@ -18,7 +18,8 @@ export class PageCtrl extends ModuleControl<EditorModule> {
     state = RxValue.create({
         currCompId: "root",
         currStreamCardId: "",
-        rootId: ""
+        rootId: "",
+        title: ''
     }, history)
 
     initEvent() {
@@ -87,6 +88,7 @@ export class PageCtrl extends ModuleControl<EditorModule> {
 
     setDesignData(data: Partial<DesignTemp>) {     
        this.designData = new DesignTemp(data);
+       this.state.title = data.title || '';
         //设置组件父子关系
         const ite = (root:any)=> {
           const cards = root.children?.default || [];