1.0.2 • Published 3 years ago

ns-el-auto-form v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

安装

npm install ns-el-auto-form

使用

// main.js
import nsElAutoFormFrom "ns-el-auto-form";
Vue.use(nsElAutoFormFrom);
// xxx.vue
<ns-el-auto-form :formNode="formNode"></ns-el-auto-form>

提交示例

<template>

  <ns-el-auto-form ref="autoForm" :formNode="formNode" >
    <template slot="submit">
      <el-button @click="submit">查询</el-button>
    </template>
  </ns-el-auto-form>

</template>

<script>
  export default {
    methods:{
      submit(){
        let formData = this.$refs['autoForm'].__submit();
        console.log(formData)
      }
    }
  }

</script>
  • inline < Boolean > 是否一行显示

  • labelWidth < String > 页面显示字段名称 的区域宽度

  • style < String > 每一项内联样式

属性类型描述
typeStringinput/checkbox/select/radio/dateBlock/dateTimeBlock/dateBlockClassic
labelString页面显示的字段名称
nameString传给后台的字段名称(key)
optionsoptionscheckbox/select/radio 的选择项
startNameString(dateBlock/dateTimeBlock/dateBlockClassic)传给后台的开始时间字段名(key)
endTimeString(dateBlock/dateTimeBlock/dateBlockClassic)传给后台的结束时间字段名(key)
defaultString默认值
startDefaultString可取值 today :当天
endDefaultString取值同startDefault
quickBooleandateBlockClassic是否开启快捷选择
  • options < ArrayObject > 选项
属性类型描述
labelString选项在页面上显示的名称
valueString选项选中后传给后台的值
childContentArray子选项,联动选择 配置项同options