Merge pull request #4195 from hsm-lv/fix-event

docs: 修复事件动作demo文档
This commit is contained in:
RUNZE LU 2022-04-29 18:17:57 +08:00 committed by GitHub
commit 6d83e387e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 29 deletions

View File

@ -195,16 +195,20 @@ order: 9
actions: [
{
actionType: 'toast',
args: {
msg: 'confirm'
}
}
]
},
cancel: {
actions: [
{
actionType: 'toast',
args: {
msg: 'cancel'
}
}
]
}
}
@ -346,16 +350,20 @@ order: 9
actions: [
{
actionType: 'toast',
args: {
msg: 'confirm'
}
}
]
},
cancel: {
actions: [
{
actionType: 'toast',
args: {
msg: 'cancel'
}
}
]
}
}
@ -2382,7 +2390,7 @@ order: 9
actionType: 'changeActiveKey',
componentId: 'tabs-change-receiver',
args: {
activeKey: 1
activeKey: 2
}
}
]

View File

@ -10,7 +10,12 @@ import { ICmptAction } from './CmptAction';
import {IContinueAction} from './ContinueAction';
import {ICopyAction} from './CopyAction';
import {ICustomAction} from './CustomAction';
import { IAlertAction, IConfirmAction, IDialogAction, ICloseDialogAction } from './DialogAction';
import {
IAlertAction,
IConfirmAction,
IDialogAction,
ICloseDialogAction
} from './DialogAction';
import {IDrawerAction, ICloseDrawerAction} from './DrawerAction';
import {IEmailAction} from './EmailAction';
import {ILinkAction} from './LinkAction';
@ -20,7 +25,6 @@ import { IParallelAction } from './ParallelAction';
import {ISwitchAction} from './SwitchAction';
import {IToastAction} from './ToastAction';
// 循环动作执行状态
export enum LoopStatus {
NORMAL,
@ -161,7 +165,9 @@ export const runAction = async (
let args = event.data;
if (actionConfig.args) {
args = dataMapping(actionConfig.args, mergeData, (key) => ['adaptor', 'responseAdaptor', 'requestAdaptor'].includes(key));
args = dataMapping(actionConfig.args, mergeData, key =>
['adaptor', 'responseAdaptor', 'requestAdaptor'].includes(key)
);
}
await actionInstrance.run(