todoList() {
return this.state.todos.map(function(element,i){
return <div todo={element} key = {i}>;
<tr>
<td>{element.todo_description}</td>
<td>{element.todo_responsible}</td>
<td>{element.todo_priority}</td>
<td>
<Link to={"/edit/"+element._id}>Edit</Link>
</td>
</tr>
</div>
})
}
render(){
return(
<div>
<h2>To Do List</h2>
<table className="table table-striped" style={{ marginTop: 20 }}>
<thead>
<tr>
<th>Description</th>
<th>Responsible</th>
<th>Priority</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{this.todoList()}
</tbody>
</table>
</div>
)
}
}
export default toDosList;
慕娘9325324
忽然笑
相关分类