Skip to content

Commit

Permalink
style(core,schema): 完善dsl定义
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen committed May 15, 2024
1 parent 7a13cd8 commit 238762d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@
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';
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[] = [];
Expand Down
6 changes: 5 additions & 1 deletion packages/schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export interface MComponent {
className?: string;
/* 关联事件集合 */
events?: EventConfig[];
/** 是否隐藏 */
visible?: boolean;
/** 显示条件中配置的数据源条件的编译结果 */
condResult?: boolean;
/** 组件根Dom的style */
style?: {
[key: string]: any;
Expand Down Expand Up @@ -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 {
/** 代码块钩子标识 */
Expand Down

0 comments on commit 238762d

Please sign in to comment.