fix: click

This commit is contained in:
chenos 2025-06-20 00:02:34 +08:00
parent 8a51539ebd
commit 725a594220
2 changed files with 8 additions and 9 deletions

View File

@ -18,15 +18,7 @@ export class ActionModel extends FlowModel {
children: 'Action',
};
render() {
return (
<Button
{...this.defaultProps}
{...this.props}
onClick={(event) => {
this.dispatchEvent('click', { event });
}}
/>
);
return <Button {...this.defaultProps} {...this.props} />;
}
}
@ -57,6 +49,12 @@ ActionModel.registerFlow({
},
handler(ctx, params) {
ctx.model.setProps('children', params.children);
ctx.model.setProps('onClick', (event) => {
ctx.model.dispatchEvent('click', {
...ctx.extra,
event,
});
});
},
},
},

View File

@ -65,6 +65,7 @@ export class TableModel extends DataBlockModel<S> {
},
]}
onModelAdded={async (model: TableColumnModel) => {
model.setSharedContext({ currentBlockModel: this });
await model.applyAutoFlows();
}}
/>