07.Forms
所有的demo源码:https://github.com/Ching-Lee/react-base
1.表单的常见操作
【07.Forms】demo09
!DOCTYPE html>
Form - 锐客网
文章图片
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 (
);
}
}
推荐阅读
- 列出所有自定义的function和view
- 凡有的,还要多给他,凡没有的,连他现有的也要拿走
- 美之初体验—我所感受到的那一点儿
- 归乡-序章(世界伊始,人类无所依靠,我的故事就从这里开始...)
- 幸福的人都是相似的,所有幸福的女人,都做好了这2点
- 恶魔天使
- 游戏治愈了我无聊之症
- 【诗】我愿我愿
- 不理解句意,你还想做对所有GRE填空题()
- 财富自由之路