class TimeEditor extends React.Component {
constructor(props) {
super(props);
this.state = {
code: 1,
employeeID: 2,
date:null,
time:null
};
}
callback_updateData()
{
this.props.loadData();
}
addNewTimestamp()
{
axios.post('/api/add_timestamp', {
code: this.state.code,
employeeID: this.state.employeeID,
date: this.state.date,
time: this.state.time
})
.then(function (response) {
console.log(response);
this.callback_updateData();
})
.catch(function (error) {
console.log(error);
});
}
}
}
TypeError:无法读取未定义的属性'callback_updateData' 在:**