项目基础确认搭建完成
This commit is contained in:
父節點
111a0149a9
當前提交
88bc6cde67
48
src/App.css
48
src/App.css
@ -1,38 +1,14 @@
|
|||||||
.App {
|
a.btn {
|
||||||
text-align: center;
|
text-decoration: none;
|
||||||
|
color: white !important;
|
||||||
|
border-radius: .5rem;
|
||||||
|
padding: .375rem 1.75rem;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
a.btn:active {
|
||||||
|
color: white !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.App-logo {
|
.btn-primary {
|
||||||
height: 40vmin;
|
background-color: #318ffb;
|
||||||
pointer-events: none;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: no-preference) {
|
|
||||||
.App-logo {
|
|
||||||
animation: App-logo-spin infinite 20s linear;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-header {
|
|
||||||
background-color: #282c34;
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: calc(10px + 2vmin);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-link {
|
|
||||||
color: #61dafb;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes App-logo-spin {
|
|
||||||
from {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,7 +6,7 @@ import { UploadContainer } from './upload/upload';
|
|||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<HashRouter>
|
<HashRouter>
|
||||||
<Route path="/" component={AppContainer} />
|
<Route path="/" exact component={AppContainer} />
|
||||||
<Route path="/upload" component={UploadContainer} />
|
<Route path="/upload" component={UploadContainer} />
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
);
|
);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
import './index.css';
|
import './index.css';
|
||||||
|
|
||||||
// copilot抄来的模板
|
|
||||||
export class AppContainer extends Component {
|
export class AppContainer extends Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
{this.props.children}
|
<p>展示页</p>
|
||||||
|
<Link to="/upload" className="btn btn-primary">前往</Link>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
import './upload.css';
|
import './upload.css';
|
||||||
|
|
||||||
// copilot抄来的模板
|
// copilot抄来的模板,可恶怎么有这么明显的bug啊
|
||||||
export class UploadContainer extends Component {
|
export class UploadContainer extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
@ -18,10 +18,9 @@ export class UploadContainer extends Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="upload-container">
|
<div className="upload-container">
|
||||||
<input type="file" onChange={this.handleChange} />
|
<input type="file" onChange={this.handleChange} multiple />
|
||||||
{this.state.files.map((file, i) => (
|
{Array.prototype.map.call(this.state.files, (file, i) => (
|
||||||
<div key={i} className="upload-item">
|
<div key={i} className="upload-item">
|
||||||
<img className="upload-item-img" src={file.preview} />
|
|
||||||
<p className="upload-item-name">{file.name}</p>
|
<p className="upload-item-name">{file.name}</p>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
載入中…
x
新增問題並參考
Block a user