diff --git a/src/routes/page/list.ts b/src/routes/page/list.ts index fd6a4e3..b0603a6 100644 --- a/src/routes/page/list.ts +++ b/src/routes/page/list.ts @@ -115,6 +115,9 @@ app title: 'demo-hello-world', cid: 'a6652ce0-82fb-432a-a6b0-2033a655b02c', root: true, + style: { + border: '1px solid black', + }, }, position: { x: 50, @@ -128,6 +131,16 @@ app label: '容器', title: 'demo-child-01', cid: '67e5b2ff-98dc-43ab-8ad9-9b062096f8eb', + style: { + color: 'green', + position: 'absolute', + border: '1px solid black', + top: '100px', + left: '100px', + width: '200px', + height: '200px', + }, + shadowRoot: true, }, position: { x: 350, @@ -141,6 +154,15 @@ app label: '容器', title: 'demo-child-03', cid: '208c3e36-dc7d-46af-b2f0-81d5f43c974d', + style: { + color: 'green', + position: 'absolute', + border: '1px solid green', + top: '100px', + left: '100px', + width: '200px', + height: '200px', + }, }, position: { x: 350, @@ -154,6 +176,15 @@ app label: '容器', title: 'demo-child-04', cid: '170c0b55-8c13-4d6e-bf35-3f935d979a0d', + style: { + color: 'green', + position: 'absolute', + border: '1px solid green', + top: '100px', + left: '400px', + width: '200px', + height: '200px', + }, }, position: { x: 650, diff --git a/src/routes/page/models/index.ts b/src/routes/page/models/index.ts index e5ae516..b4faa28 100644 --- a/src/routes/page/models/index.ts +++ b/src/routes/page/models/index.ts @@ -1,9 +1,26 @@ import { sequelize } from '../../../modules/sequelize.ts'; import { DataTypes, Model } from 'sequelize'; +type PageNodeData = { + id: string; + type: string; + data: { + label?: string; // 容器 开始 结束 + root?: boolean; // 是否是根节点 + + // 容器上的属性 + cid?: string; // 容器id + style?: { [key: string]: string }; + className?: string; + showChild?: boolean; + shadowRoot?: boolean; + }; + + [key: string]: any; +}; export interface PageData { edges: any[]; - nodes: any[]; + nodes: PageNodeData[]; viewport: any; [key: string]: any; }