amis icon indicating copy to clipboard operation
amis copied to clipboard

this.props.onAction执行报错

Open wenchuanli opened this issue 9 months ago • 3 comments

实现场景:

amis6.11.0、react18

逻辑是实现在自定义组件中关闭弹窗的功能。困扰很久了,请大佬们帮忙解答,在此谢过!!

在自定义组件中执行代码: this.props.onAction({ actionType: 'dialog.close', componentId: 'u:ui_schema_edit_dg' });

错误信息: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'from')

存在的问题:

当前方案:

{ "type": "button", "icon": "fa fa-code", "vendor": "", "id": "u:ea6c903bc13a", "disabledOnAction": false, "actionType": "dialog", "dialog": { "type": "dialog", "title": "", "body": [ { "type": "custom-schema-editor", // 自定义组件 "className": "h-full", "id": "u:fb573edc56c3", "name": "lca003" } ], "id": "u:ui_schema_edit_dg", "actions": [], "showCloseButton": true, "closeOnOutside": false, "closeOnEsc": false, "showErrorMsg": true, "showLoading": true, "draggable": false, "editorSetting": { "displayName": "页面编辑" }, "hideActions": false, "size": "full", "name": "dialog_1", "actionType": "dialog", "style": { "width": "px" } } }

code here...

wenchuanli avatar Mar 31 '25 07:03 wenchuanli

👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

github-actions[bot] avatar Mar 31 '25 07:03 github-actions[bot]

你是不是搞错了??

doAction({
  "ignoreError": false,
  "actionType": "closeDialog"
})

Amis低代码前端框架交流群【QQ1群】:717791727 Amis低代码前端框架交流群【QQ2群】:721182449

lhtuling avatar Apr 09 '25 09:04 lhtuling

props 里面没有doAction

xiuxiuyifan avatar May 12 '25 11:05 xiuxiuyifan