import Button from '../../button'; import Field from '..'; import Input from '../../input'; import React from 'react'; import ReactDOM from 'react-dom'; import Table from '../../table'; class Demo extends React.Component { getValues: () => void; field: any; input: (value: any, index: any) => JSX.Element; op: (value: any, index: any) => JSX.Element; idx: number; constructor(props) { super(props); this.getValues = () => { const values = this.field.getValues(); console.log(values); }; this.input = (value, index) => ( ); this.op = (value, index) => { return ( ); }; this.idx = 3; this.field = new Field(this, { parseName: true, values: { name: [ 0, 1, 2, 3 ].map(i => { return { id: i, input: i }; }), }, }); } addItem(index) { ++this.idx; this.field.addArrayValue('name', index, { id: this.idx, input: this.idx }); } removeItem(index) { this.field.deleteArrayValue('name', index); } render() { const dataSource = this.field.getValue('name'); return (
          {JSON.stringify(dataSource, null, 2)}
        
); } } ReactDOM.render(, document.getElementById('field-demo-8'));