# form-runner-sdk

> form-runner-sdk

Latest version **1.0.0** (published 2021-09-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install form-runner-sdk
pnpm add form-runner-sdk
yarn add form-runner-sdk
bun add form-runner-sdk
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-09-03 |
| First published | 2021-09-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 290.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | qiangxie |
| Maintainers | thankstrong |

## Links

- npm: https://www.npmjs.com/package/form-runner-sdk
- Repository: https://git.xiaojukeji.com/transformer/form-runner-sdk
- npm.io page: https://npm.io/package/form-runner-sdk

## Recent versions

- 1.0.0 (latest) — 2021-09-03

## README

# 表单引擎

## 执行流程
1. new sdk，传入el和参数，挂载在el上，此实例上绑定了表单的基本信息和钩子函数；
2. 调用实例的执行引擎方法；
3. 调用引擎接口获取表单数据；
4. 依据表单数据动态渲染表单，绑定逻辑校验和事件；
5. 提交表单结果；
6. 触发提交完成钩子函数，在回调函数中返回实例Id；

## 示例
``` js
<div id="formSDK"></div>
<scrip>
  const formIns = new FormRunnerSDK({
    el: '#formSDK',
    formKey: '',
    version：1，// 不传默认最新版本
    instanceId： ''， // 实例id
    // 初次渲染表单
    initParam: {},
    // 表单配置
    config: {}，
    // 渲染表单前
    beforeUpdate：{}，
    // 提交前
    beforeCommit：() => {},
    // 提交后
    afterCommit： () => {},
    // 逻辑校验错误
    onInVaild: () => {},
    // 表单引擎出错
    errorBack：() => {}，
  })
</script>
```
## 注意事项
1. el和formKey为必传项；
2. 当同时传入instanceId和initParam时，instanceId的优先级更高；

---
_Source: https://npm.io/package/form-runner-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
