Socket
Book a DemoInstallSign in
Socket

form-view-builder

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

form-view-builder

## 使用

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

form builder 文档

使用

  • 安装依赖
npm install form-view-builder -S
  • 初始化
import FormBuilder from 'form-view-builder'
import 'form-view-builder/dist/form-view-builder.css'
Vue.use(FormBuilder)
  • 代码示例
<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>
  • 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 12 Aug 2020

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