当前位置:网站首页>Click the Add button - a box appears (similar to adding learning experience - undergraduate - Graduate)
Click the Add button - a box appears (similar to adding learning experience - undergraduate - Graduate)
2022-04-23 05:21:00 【process1212】
import React, { Component } from "react";
class Inner extends Component {
defaultValue = {
taskDescription: "",
vehicleClean: ""
};
constructor() {
super();
this.state = [
{
taskDescription: "",
vehicleClean: ""
}
];
}
changeClean = e => {
let clean = e.target.value;
console.log(this);
this.setState({
vehicleClean: this.state.vehicleClean.concat(clean)
});
console.log(this.state.vehicleClean);
};
changeDescription = e => {
// console.log(e.target.value);
let description = e.target.value;
this.setState({
taskDescription: description
});
};
componentWillMount = () => {
this.showInner();
};
showInner = () => {
this.setState( this.state.push(Object.assign({}, this.defaultValue)));
console.log(result);
taskModel = result.map((item, index) => (
<span key={index}>
<select
name="vehicleClean"
className="vehicle-clean"
onChange={e => this.changeClean(e)}
>
<option value=""> Please select </option>
<option value=" Wash the car "> Wash the car </option>
<option value=" Car rental "> Car rental </option>
<option value=" interior "> interior </option>
<option value=" Wax "> Wax </option>
<option value=" Film "> Film </option>
</select>
<input
type="text"
name="taskDescription"
className="taskZheng"
value={this.state.description}
onChange={e => this.changeDescription(e)}
/>
<br />
</span>
));
};
render() {
return <span>{taskModel}</span>;
}
}
export default class AddTask extends Component {
constructor() {
super();
this.state = {
taskWarn: "",
taskHelper: ""
};
}
addInner = e => {
e.preventDefault();
this.refs.get.showInner();
this.setState({
taskWarn: ""
});
};
render() {
return (
<li>
<label className="title"> Monthly tasks </label>
<div className="table-content">
<div className="task-container">
<Inner ref="get" />
</div>
<button
className="add-button"
id="add-button"
onClick={e => this.addInner(e)}
>
add to
</button>
</div>
<div className="error">
<span id="cleanWarn" className={this.state.taskWarn}>
{this.state.taskHelper}
</span>
</div>
</li>
);
}
}
版权声明
本文为[process1212]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230519446252.html
边栏推荐
- 何时适合进行自动化测试?(下)
- Traversal of tree
- 【openh264】cmake: msopenh264-static
- Flip coin (Blue Bridge Cup)
- Unique primary key ID of tidb sub table -- solution to failure of sequence and Gorm to obtain primary key
- egg中的多进程模型--egg文档搬运工
- 引入精益管理方式,需要提前做到这九点
- Redis的基本知识
- egg中的cors和proxy(づ ̄3 ̄)づ╭~踩坑填坑的过程~ToT~
- egg测试的知识大全--mock、superTest、coffee
猜你喜欢

phphphphphphphp

MySQL circularly adds sequence numbers according to the values of a column
![[untitled]](/img/49/770888f4f351f42af0e01c3a15ddfa.png)
[untitled]

Blender程序化地形制作

Traversal of tree

Project manager's thinking mode worth trying: project success equation

项目经理值得一试的思维方式:项目成功方程式

Basic theory of Flink

Qingdao agile tour, coming!

Top 25 Devops tools in 2021 (Part 2)
随机推荐
Basic use of sqlyog
《2021年IT行业项目管理调查报告》重磅发布!
egg的static的前缀是可以修改惹,靴靴
2021-11-01
4 most common automated test challenges and Countermeasures
The source of anxiety of graduating college students looking for technology development jobs
Where, on when MySQL external connection is used
看板快速启动指南
学习笔记:Unity CustomSRP-11-Post Processing---Bloom
Logrus set log format and output function name
Interview summary
WTL self drawn control library (cqscheckcomboxbox)
项目经理值得一试的思维方式:项目成功方程式
Redis persistence
Laravel routing job
How to realize adaptive layout
Open source rule engine - Ice: dedicated to solving flexible and complex hard coding problems
Swing display time (click once to display once)
青岛敏捷之旅,来了!
Routing parameters