07.Forms

所有的demo源码:https://github.com/Ching-Lee/react-base
1.表单的常见操作 【07.Forms】demo09

!DOCTYPE html> Form - 锐客网

07.Forms
文章图片
2.多个input文件上传 可以只写一个handleInputChange函数,根据类型不同来修改不同的state对象的属性。
class Reservation extends React.Component { constructor(props) { super(props); this.state = { isGoing: true, numberOfGuests: 2 }; this.handleInputChange = this.handleInputChange.bind(this); }handleInputChange(event) { const target = event.target; const value = https://www.it610.com/article/target.type ==='checkbox' ? target.checked : target.value; const name = target.name; this.setState({ [name]: value }); }render() { return (

); } }

    推荐阅读