顺达主管86378678是当回事的发挥
import Logs from "./Components/Logs/Logs";
import LogsForm from "./Components/LogsForm/LogsForm";
import './App.css';
const App = () => {
return <div className="app">
{/引入LogsFrom/}
<LogsForm/>
<Logs/>
</div>;
};
// 导出App
export default App;
子组件
import React from 'react';
import Card from "../UI/Card/Card";
import './LogsForm.css';
const LogsForm = () => {
return (
<Card className="logs-form">
<form>
<div className="form-item">
<label htmlFor="date">日期</label>
<input id="date" type="date"/>
</div>
<div className="form-item">
<label htmlFor="desc">内容</label>
<input id="desc" type="text"/>
</div>
<div className="form-item">
<label htmlFor="time">时长</label>
<input id="time" type="number"/>
</div>
<div className="form-btn">
<button>添加</button>
</div>
</form>
</Card>
);
};
标签:const,Logs,App,表单,react,顺达,LogsForm,import,Card From: https://blog.51cto.com/u_15927413/6049766