New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cgkj-form-generator

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cgkj-form-generator

表单设计器 渲染器

  • 2.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
2
Weekly downloads
 
Created
Source

表单设计器

npm:cgkj-form-generator - npm (npmjs.com)

1. 使用

1.1 设计器 Design

引用方式

import { Design } from 'cgkj-form-generator';

<Design @save="handleSave" :formJson.sync="formJson" :formConf.sync="formConf" />

handleSave({formJson, formConf}){
    ......
}

参数

参数名类型必填默认值备注
formJsonArray表单项 json,必须加修饰符.sync
formConfObjectdefaultFormConf表单整体配置,必须加修饰符.sync

事件回调

事件名回调参数说明
savefunction({formJson, formConf})保存表单的回调

2.2 渲染器 Parser

引用方式

import { Parser } from 'cgkj-form-generator';

  <Parser    
	:formConf="formConf"
    :formJson="formJson"
    :formModel="formModel" 
  />

参数

参数名类型必填默认值备注
formJsonArray表单项 json
formConfObject表单整体配置
formModelObject表单model(各字段的值)

方法

方法名参数说明
validateFunction(callback: Function(boolean,object))对整个表单进行校验的方法,参数为一个回调函数。该回调函数会在校验结束后被调用,并传入两个参数:是否校验成功和表单model

2. 开发

2.1 概述

​ 引用的部分aiurt-vue组件在dev时有异常尚未解决(好在lib下没问题)

2.2 新增组件

  1. src\components\generator\config中定义组件配置,在src\components\generator\config\index.js中导出。

    image-20221108104045869

  2. 在src\components\generator\config.js中引入组件,并进行分类。

image-20221108104717449

  1. **需要注意:**组件的配置方案见代码,是否兼容右面板和渲染器因组件而异,不满足的需进行合理开发。

FAQs

Package last updated on 27 Mar 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc