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 🙏

© 2026 – Pkg Stats / Ryan Hefner

form-generate-vue3

v1.0.3

Published

> 本组件旨在可以根据配置文件,快速生成可验证表单 > @TODO 条件组件递归显示实现 > @TODO 自定义表单验证组件实现

Readme

使用样例

本组件旨在可以根据配置文件,快速生成可验证表单 @TODO 条件组件递归显示实现 @TODO 自定义表单验证组件实现

<template>
   <div>
      <el-form ref="ruleFormRef" :model="formData" label-width="120px">
         <form-generate 
            :columnList="formOptions"
            :formData = "formData"
            :columnSpan="12"
         />
         <el-form-item>
            <el-button type="primary" @click="submitForm(ruleFormRef)">
               Create
            </el-button>
         </el-form-item>
      </el-form>
   </div>
</template>

<script setup name="User">
import { reactive } from 'vue';
const ruleFormRef  = ref()
const formOptions = [
   {
   "name": "name1",
   "type": "text",
   "title": "栏目标题",
   "rules": [
      {required: true,  trigger: 'change', message: '请输入'}
   ]
   },
   {
   "name": "name",
   "type": "text",
   "title": "栏目名称"
   },
   {
   "name": "total",
   "type": "number",
   "title": "栏目数量",
   
   "rules": [
      {required: true,  trigger: 'change'}
   ]
   },
   {
   "name": "count",
   "type": "number",
   "title": "浏览数量"
   },
   {
   "name": "descript",
   "type": "textarea",
   "title": "备注",
   "rows": 3,
   "rules": [
      {required: true,  trigger: 'change'}
   ]
   },
   {
      "name": "content",
      "type": "textarea",
      "title": "内容",
      "rows": 3
   },
   {
      "name": "startDate",
      "type": "date",
      "title": "开始日期",
      "required": true
   },
   {
      "name": "endDate",
      "type": "date",
      "title": "结束日期"
   },
   {
      "name": "isValid",
      "type": "switch",
      "title": "是否有效"
   },
   {
      "name": "isExpired",
      "type": "switch",
      "title": "是否过期",
      "required": true
   },
   {
   "name": "type",
   "type": "radio",
   "dictionary": [
      {
         "code": 1,
         "name": "横版栏目"
      },
      {
         "code": 2,
         "name": "竖版栏目"
      }
   ],
   "title": "栏目类型",
   "controls": [
      {
         "value": 1,
         "showCondition": [
            {
               "name": "show",
               "type": "radio",
               "dictionary": [
                  {
                  "code": 1,
                  "name": "China"
                  },
                  {
                  "code": 2,
                  "name": "English"
                  }
               ],
               "title": "测试类型",
               "required": true
            }
         ]
      },
      {
         "value": 2,
         "showCondition": [
         {
            "name": "isValids",
            "type": "switch",
            "title": "是否有效"
         }
         ]
      }
   ]
   },
   {
   "name": "requireType",
   "type": "radio",
   "dictionary": [
      {
         "code": 1,
         "name": "类型一"
      },
      {
         "code": 2,
         "name": "类型二"
      }
   ],
   "title": "图文类型",
   "required": true
   },
   {
   "name": "range",
   "type": "checkbox",
   "title": "发布范围",
   "dictionary": [
      {
         "code": 1,
         "name": "范围一"
      },
      {
         "code": 2,
         "name": "范围二"
      }
   ],
   "required": true
   },
   {
   "name": "dateRange",
   "type": "daterange",
   "title": "日期范围"
   },
   {
   "name": "creType",
   "type": "select",
   "dictionary": [
      {
         "code": 1,
         "name": "身份证"
      },
      {
         "code": 2,
         "name": "居住证"
      }
   ],
   "title": "证件类型"
   },
   {
   "name": "image",
   "type": "image",
   "title": "头像"
   }
]
const formData = reactive({
   "name1": '',
   "name": "主菜单栏目",
   "total": null,
   "count": null,
   "createDate": 1606730360386,
   "type": 1,
   "creType": "",
   "range": [],
   "isExpired": false,
   "isValid": true
})
const submitForm = async (formEl) => {
  if (!formEl) return
  console.log(formData)
  await formEl.validate((valid, fields) => {
    if (valid) {

      console.log('submit!')
    } else {
      console.log('error submit!', fields)
    }
  })
}
</script>