This commit is contained in:
2021-05-17 01:13:37 +08:00
parent a8a4fdef9b
commit 0c3a0cee38
5 changed files with 15 additions and 66 deletions
-38
View File
@@ -1,38 +0,0 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
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);
}
}
+9 -22
View File
@@ -1,25 +1,12 @@
import logo from './logo.svg'; import React from 'react'
import './App.css';
function App() { class App extends React.Component{
return ( render(h) {
<div className="App"> return (
<header className="App-header"> <div className="app">
<img src={logo} className="App-logo" alt="logo" /> <h1>chenxuan</h1>
<p> </div>
Edit <code>src/App.js</code> and save to reload. )
</p> }
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
} }
export default App; export default App;
-4
View File
@@ -10,8 +10,4 @@ ReactDOM.render(
</React.StrictMode>, </React.StrictMode>,
document.getElementById('root') document.getElementById('root')
); );
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals(); reportWebVitals();
+5 -1
View File
@@ -15,4 +15,8 @@ npm run start
npm i -g serve npm i -g serve
6、启动本地服务 6、启动本地服务
serve -s build serve -s build
7、dangerouslySetInnerHTML
8、ReactDom.findDOMNode
9、refs
+1 -1
View File
@@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import ReactDom from 'react-dom'; import ReactDom from 'react-dom';
import HeaderComponent from './components/header/index' import HeaderComponent from './components/header/index';
class App extends React.Component{ class App extends React.Component{
componentDidMount(){ componentDidMount(){
// ref属性 // ref属性