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 { 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[] = [];

View File

@ -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 {
/** 代码块钩子标识 */