From 238762dd0f526a51bb141878b47bcbbea9ccfc2c Mon Sep 17 00:00:00 2001 From: roymondchen Date: Wed, 15 May 2024 20:25:35 +0800 Subject: [PATCH] =?UTF-8?q?style(core,schema):=20=E5=AE=8C=E5=96=84dsl?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/Node.ts | 8 ++++---- packages/schema/src/index.ts | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/core/src/Node.ts b/packages/core/src/Node.ts index b48d818a5..f44c2afc4 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 9b4666fc4..acba1a8c4 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 { /** 代码块钩子标识 */