【发布时间】:2018-03-03 12:31:18
【问题描述】:
我正在尝试获取我正在使用的react-handsontable 组件中更改的值:
<HotTable root="hot"
data={this.state.handsontableData}
colHeaders={this.handsontableColumns}
rowHeaders={true}
width="1200"
height="300"
stretchH="all"
colWidths={this.handsontableColWidths}
onAfterChange={this.handleHOTChange(changes, source)} />
但是,onAfterChange={this.handleHOTChange(changes, source)} 抛出错误:
./src/MyComponent.jsx
Line 73: 'changes' is not defined no-undef
Line 73: 'source' is not defined no-undef
谁能告诉我如何从事件中获得“更改”?
如果我只使用不带参数的onAfterChange={this.handleHOTChange},那么handleHOTchanges 函数会在更改时被调用。但是,我如何确定发生了什么变化?
【问题讨论】:
标签: javascript reactjs handsontable