
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
ant-formdesign
Advanced tools
基于Vue,ElementUI开发的一款表单设计器,提高表单开发效率的利器,让开发者从枯燥的表单代码编写中解放出来

<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/ant-formdesign@1.1.0/dist/formdesign.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/ant-formdesign@1.1.0/dist/formdesign.umd.js"></script>
<fm-generate-form></fm-generate-form>
import {MakingForm} from 'form-making'
Vue.component(MakingForm.name, MakingForm)
<fm-making-form preview generate-code generate-json>
<template slot="action">
</template>
</fm-making-form>
| Prop name | Description | Type | Default value |
|---|---|---|---|
| preview | 预览,头部操作按钮 | Boolean | false |
| generate-json | 生成JSON | Boolean | false |
| generate-code | 生成代码 | Boolean | false |
| Function name | Description |
|---|---|
getJSON | 获取设计器生成的JSON数据 |
getHtml | 获取生成可使用的html代码 |
setJSON(value) | 根据value值设置表单设计器 |
| Slot name | Description |
|---|---|
| action | 自定义设计器操作按钮,展示在设计头部区域 |
下面就是加载对应的数据用于展示,假设你已经正确加载组件
<fm-generate-form
:data="jsonData"
:remote="remoteFuncs"
:value="values"
ref="generateForm">
</fm-generate-form>
new Vue({
...
data () {
return {
jsonData: {}, // 表单配置中生成的json数据
values: {}, // 表单需要显示的表单数据
remoteFuncs: {
// 组件配置时配置的远端方法,保持和配置时输入的名称一致
func_test (resolve) {
// 模拟接口请求
setTimeout(() => {
const options = [
{id: '1', name: '1111'},
{id: '2', name: '2222'},
{id: '3', name: '3333'}
]
// 获取到的值和标签可以通过配置页远端配置
// 值:id 标签:name
resolve(options) // 将后端获取的数据放入回调函数中
}, 2000)
},
func_test2....
}
}
},
methods: {
...{
// 调用此方法验证表单数据和获取表单数据
this.$refs.generateForm.getData().then(data => {
// 数据校验成功
// data 为获取的表单数据
}).catch(e => {
// 数据校验失败
})
}
}
})
FAQs
We found that ant-formdesign demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.