diff --git a/packages/core/src/Node.ts b/packages/core/src/Node.ts index b48d818a..f44c2afc 100644 --- a/packages/core/src/Node.ts +++ b/packages/core/src/Node.ts @@ -19,7 +19,7 @@ import { EventEmitter } from 'events'; import { DataSource } from '@tmagic/data-source'; -import type { AppCore, EventConfig, MComponent, MContainer, MPage, MPageFragment } from '@tmagic/schema'; +import type { AppCore, EventConfig, MComponent, MContainer, MNode, MPage, MPageFragment } from '@tmagic/schema'; import { HookCodeType, HookType } from '@tmagic/schema'; import type App from './App'; @@ -27,14 +27,14 @@ import type Page from './Page'; import Store from './Store'; interface NodeOptions { - config: MComponent | MContainer; + config: MNode; page?: Page; parent?: Node; app: App; } class Node extends EventEmitter { - public data!: MComponent | MContainer | MPage | MPageFragment; - public style?: { + public data!: MNode; + public style!: { [key: string]: any; }; public events: EventConfig[] = []; diff --git a/packages/schema/src/index.ts b/packages/schema/src/index.ts index 9b4666fc..acba1a8c 100644 --- a/packages/schema/src/index.ts +++ b/packages/schema/src/index.ts @@ -131,6 +131,10 @@ export interface MComponent { className?: string; /* 关联事件集合 */ events?: EventConfig[]; + /** 是否隐藏 */ + visible?: boolean; + /** 显示条件中配置的数据源条件的编译结果 */ + condResult?: boolean; /** 组件根Dom的style */ style?: { [key: string]: any; @@ -198,7 +202,7 @@ export interface PastePosition { top?: number; } -export type MNode = MComponent | MContainer | MPage | MApp; +export type MNode = MComponent | MContainer | MPage | MApp | MPageFragment; export enum HookType { /** 代码块钩子标识 */