amis icon indicating copy to clipboard operation
amis copied to clipboard

Action 如何执行多个动作

Open CheneyWong opened this issue 4 years ago • 3 comments

实现场景:

action 触发一直,既要发送 ajax,又要给其他组件发送数据。

存在的问题:

一个 action 只能有一种 actionType,不够用。

CheneyWong avatar Feb 16 '22 06:02 CheneyWong

参考自定义事件,里面通过 props 访问 amis 方法

{
  "type": "page",
  "body": {
    "label": "点击",
    "type": "button",
    "onClick": "props.onAction(event, {actionType:'drawer', drawer: {title: '弹drawer', body: 'drawer'}});props.onAction(event, {actionType:'dialog', dialog: {title: 'dialog', body: 'dialog'}})"
  }
}

gauliang avatar Feb 23 '22 10:02 gauliang

可以等等新的事件机制

nwind avatar Feb 28 '22 04:02 nwind

点击buton发送一个请求,请求回来根据上一个请求返回参数判断再发另一个请求

0undefined0 avatar Feb 28 '22 07:02 0undefined0