npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

zall-form-generator

v1.3.8

Published

just learn form-generator

Readme

简介

为了了解自定义表单的基本实现原理,在 form-generator 项目基础上做了一点点改造,以满足自身的需求。

效果展示

  • Web端效果展示
  • H5效果展示

配置

vue.config.js 新增一栏配置

module.exports = {
	// 编译 zall-form-generator
	transpileDependencies: ['zall-form-generator'], 
}

基本使用

FormGeneratorComponent

主要用于拖拽组件,根据自身需要设置表单基本信息

  • 引入组件

import {FormGeneratorComponent} from 'zall-form-generator'

  • 使用组件

<form-generator-component :data="data" :config="formConfig"/>

data 的数据格式如下:

{
	"fields": [
		{
			"__config__": {
				"label": "单行文本",
				"labelWidth": null,
				"showLabel": true,
				"changeTag": false,
				"tag": "el-input",
				"tagIcon": "input",
				"required": true,
				"layout": "colFormItem",
				"span": 24,
				"document": "https://element.eleme.cn/#/zh-CN/component/input",
				"regList": [],
				"syncList": [],
				"formId": 107,
				"renderKey": "1071667530074981"
			},
			"__slot__": {
				"prepend": "",
				"append": ""
			},
			"placeholder": "请输入单行文本",
			"style": {
				"width": "100%"
			},
			"clearable": true,
			"prefix-icon": "",
			"suffix-icon": "",
			"maxlength": null,
			"show-word-limit": false,
			"readonly": false,
			"disabled": false,
			"__vModel__": "field107"
		},
		{
			"__config__": {
				"label": "单行文本",
				"labelWidth": null,
				"showLabel": true,
				"changeTag": true,
				"tag": "el-input",
				"tagIcon": "input",
				"required": true,
				"layout": "colFormItem",
				"span": 24,
				"document": "https://element.eleme.cn/#/zh-CN/component/input",
				"regList": [
					{
						"pattern": "/^1(3|4|5|7|8|9)\\d{9}$/",
						"message": "手机号格式错误"
					}
				]
			},
			"__slot__": {
				"prepend": "",
				"append": ""
			},
			"__vModel__": "mobile",
			"placeholder": "请输入手机号",
			"style": {
				"width": "100%"
			},
			"clearable": true,
			"prefix-icon": "el-icon-mobile",
			"suffix-icon": "",
			"maxlength": 11,
			"show-word-limit": true,
			"readonly": false,
			"disabled": false
		}
	],
	"formRef": "elForm",
	"formModel": "customFormData",
	"size": "medium",
	"labelPosition": "top",
	"labelWidth": 100,
	"formRules": "rules",
	"gutter": 15,
	"disabled": false,
	"span": 24,
	"formBtns": true,
	"formLogoUrl": "zall-dddssss/CONTENT_CENTER/er6czr1kqgo51w0.jpeg",
	"formName": "表单名称表单名称",
	"formRemark": "表单说明表单说",
	"submitBtnText": "提交",
	"type": "add"
}

formConfig 的数据格式如下:

{
        "fileBaseUrl": "", // 展示图片的前缀
        "fileAction": "", // 上传图片的接口路径
        "fileUploadName": "file",
        "fileHeaders": {
          // 其他部分自定义Header...
        }
      },

Parser

主要用于渲染组件

  • 引入组件

import {Parser} from 'zall-form-generator'

  • 使用组件

<parser :form-conf="data" />

data的数据格式,同上方的data一致。

参考

在这里非常感谢 form-generator 项目的付出,更多自定义表单的使用细节,可参考 form-generator

LICENSE

MIT