|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="form" >
|
|
|
- <by-tool :propConfig="toolConfig" />
|
|
|
+ <by-tool :propConfig="toolConfig" @onAdd="onAdd" />
|
|
|
<by-form :propConfig="config" ref="form" />
|
|
|
<el-button type="primary" @click="getFormData">获取数据</el-button>
|
|
|
<el-button type="primary" @click="getFormVali">获取表单验证</el-button>
|
|
@@ -95,12 +95,16 @@ export default class DemoForm extends Vue {
|
|
|
}
|
|
|
|
|
|
toolConfig={
|
|
|
- onAdd:true,
|
|
|
- onUpdate:true,
|
|
|
- onDelete:true,
|
|
|
- onExport:true
|
|
|
+ tools:{
|
|
|
+ onAdd:true,
|
|
|
+ onUpdate:true,
|
|
|
+ onDelete:true,
|
|
|
+ onExport:true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ onAdd(){
|
|
|
+ console.log('点击新增')
|
|
|
}
|
|
|
-
|
|
|
getFormData(){
|
|
|
let data = (this as any).$refs.form.getValue();
|
|
|
console.log('表单数据:',data);
|