Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pfan/form-view-builder

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pfan/form-view-builder

## 使用

  • 0.0.20
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

form builder 文档

使用

  1. 安装依赖
npm install @pfan/form-view-builder -S
  1. 初始化
import FormBuilder from '@pfanform-view-builder'
import '@pfanform-view-builder/dist/form-view-builder.css'
Vue.use(FormBuilder)
  1. 代码示例
<template>
  <form-view-builder
    v-model="value"
    ref="form"
    v-if="config"
    :json="json"
    :custom="config"
    :controls="controls"
    :state="state"
    @validate="idValidate" />
</template>
<script>
export default {
  data() {
    return {
      value: {},
      config: {},
      json: {},
      controls: {},
      state: ''
    }
  },
  methods: {
    idValidate() {
      console.log('---校验---')
    }
  }
}
</script>
  1. API
属性说明类型默认值
value数据源,由 json 中 name 自动生成的数据源Object{}
controls控制项, 由 json 中 controls 自动生成的控制项,其中 show 属性由 form 自动生成。Object-
config自定义方法配置项,配置项中方法名与 json 中 config 中方法名保持一致,用于组件触发相应方法Object-
state状态栏,值与 json 中 controls 中子属性的状态相对应Stringinsert
json配置文件,最核心的配置项,详情见 json配置详情Object-

FAQs

Package last updated on 21 Apr 2022

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