style(core,schema): 完善dsl定义

This commit is contained in:
roymondchen 2024-05-15 20:25:35 +08:00
parent 7a13cd851b
commit 238762dd0f
2 changed files with 9 additions and 5 deletions

View File

@ -19,7 +19,7 @@
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import { DataSource } from '@tmagic/data-source'; 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 { HookCodeType, HookType } from '@tmagic/schema';
import type App from './App'; import type App from './App';
@ -27,14 +27,14 @@ import type Page from './Page';
import Store from './Store'; import Store from './Store';
interface NodeOptions { interface NodeOptions {
config: MComponent | MContainer; config: MNode;
page?: Page; page?: Page;
parent?: Node; parent?: Node;
app: App; app: App;
} }
class Node extends EventEmitter { class Node extends EventEmitter {
public data!: MComponent | MContainer | MPage | MPageFragment; public data!: MNode;
public style?: { public style!: {
[key: string]: any; [key: string]: any;
}; };
public events: EventConfig[] = []; public events: EventConfig[] = [];

View File

@ -131,6 +131,10 @@ export interface MComponent {
className?: string; className?: string;
/* 关联事件集合 */ /* 关联事件集合 */
events?: EventConfig[]; events?: EventConfig[];
/** 是否隐藏 */
visible?: boolean;
/** 显示条件中配置的数据源条件的编译结果 */
condResult?: boolean;
/** 组件根Dom的style */ /** 组件根Dom的style */
style?: { style?: {
[key: string]: any; [key: string]: any;
@ -198,7 +202,7 @@ export interface PastePosition {
top?: number; top?: number;
} }
export type MNode = MComponent | MContainer | MPage | MApp; export type MNode = MComponent | MContainer | MPage | MApp | MPageFragment;
export enum HookType { export enum HookType {
/** 代码块钩子标识 */ /** 代码块钩子标识 */