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

@lefreet/vue-form

v1.0.13

Published

基础表单组件

Downloads

46

Readme

基于element-ui的vue表单组件封装,通过配置生成表单

Build Status

live demo

说明

通过config配置项生成一张表单,起因是项目应用中,有几百张表单要通过对应的json配置自动生成,方便通过配置维护,才做了这个组件。

组件的npm包名称是@lefreet/vue-form,不是vue-form。不想取别的名字了,@lefreet/vue-form更关注表单配置抽象和简单取值。

  • 发现低版本的脚手架存在postcss-url的依赖缺失问题, 集成本组件时发现postcss-url引用报错,执行:npm i postcss-url -D解决.

使用

# install
npm install @lefreet/vue-form --save
<template>
  <div id="app">
    <vue-form :config="config" @submit="submit" ref="form"></vue-form>
  </div>
</template>

<script>
  import VueForm from '@lefreet/vue-form'

  export default {
    components: { VueForm },
    data () {
      return {
        config: {
          'cols': 1,
          'label-width': '200px',
          'values': {},
          'fields': [{
            'type': 'input',
            'prop': 'name',
            'label': 'name',
            'options': {
              // some options of element component
              'placeholder': 'input your name'
            }
          }, {
            'type': 'radio',
            'prop': 'sex',
            'label': 'sex',
            'options': {
              // some extend options by me
              'radios': [{
                'label': 'man',
                'value': 1  
              }, {
                'label': 'woman',
                'value': 2
              }]
            }
          }]
        }
      }
    },
    methods: {
      // on submit event to get form's values by verifying
      submit (values) {
        console.log(values)
      },
      // use method to clear all fields
      clear () {
        this.$refs['form'].clearFields()
      }
    }
  }
</script>

可选控件列表

  • input 文本框
  • radio 单选框
  • checkbox 复选框
  • select 下拉框
  • switch 开关
  • tree 树形下拉框
  • date 时间选择框
  • upload 文件上传
  • richtext 富文本编辑器(vue-quill-editor)

具体用法见live demo欢迎提issue