我正在尝试向 API 添加 imgUrl、给定的标题和描述。
import "./App.css";
import axios from "axios";
import React, { Component } from "react";
import ToDoList from "./Components/ToDoList";
class App extends Component {
state = {
todo: [],
};
componentDidMount() {
this.getData();
}
getData = () => {
axios
.get("https://api.vschool.io/oscarc/thing")
.then((res) => this.setState({ todos: res.data }))
.catch((err) => console.log(err));
};
render() {
return (
<div>
<ToDoList />
</div>
);
}
}