add form submit example

This commit is contained in:
hufeixiong
2021-08-05 15:13:57 +08:00
parent 6323b9419f
commit 90a4ce0285
8 changed files with 234 additions and 13 deletions

View File

@@ -2,9 +2,41 @@
* @Author: yehuozhili
* @Date: 2021-07-07 14:22:51
* @LastEditors: yehuozhili
* @LastEditTime: 2021-07-09 13:52:51
* @LastEditTime: 2021-08-05 14:53:12
* @FilePath: \dooringx\packages\dooringx-example\src\plugin\functionMap\index.ts
*/
import { FunctionCenterType } from 'dooringx-lib/dist/core/functionCenter';
export const functionMap: FunctionCenterType = {};
export const functionMap: FunctionCenterType = {
: {
fn: (ctx, next, _config, args) => {
const arr = args['_sk'];
const key = args['_r'];
const param: Record<string, any> = {};
arr.forEach((v: string) => {
param[v] = ctx[v];
});
ctx[key] = param;
console.log(ctx);
next();
},
config: [
{
name: '输入要获取的上下文',
data: ['ctx'],
options: {
receive: '_sk',
multi: true,
},
},
{
name: '输入要生成的上下文',
data: ['ctx'],
options: {
receive: '_r',
multi: false,
},
},
],
},
};