no message

This commit is contained in:
chenxuan
2024-04-12 14:01:58 +08:00
parent 59dfc3e6b3
commit d0b332c53c
4 changed files with 14 additions and 10 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ class App extends React.Component {
}
render() {
return (
<div>
<div className="app1">
<h2>当前组件state:{this.state.age}</h2>
<h2>props:{this.props.title}</h2>
<h2>props:{this.props.name}</h2>
+1 -1
View File
@@ -13,7 +13,7 @@ class App extends React.Component {
}
render() {
return (
<div>
<div className="app2">
{/* <NoStatusComponents title="我是无状态子组件" sendParent={this.getValue.bind(this)} /> */}
<h1>{this.props.title}</h1>
<h1>{this.props.name}</h1>
+8 -5
View File
@@ -6,8 +6,11 @@ body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
.app2,
.app1{
box-sizing:border-box;
width: 500px;
border: 1px solid red;
padding: 24px;
margin: 24px 0 24px 48px;
}
+4 -3
View File
@@ -1,14 +1,15 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
// import App from './App2';
import App from './App1';
import App1 from './App1';
import App2 from './App2';
import reportWebVitals from './reportWebVitals';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
<App1 />
<App2 />
</React.StrictMode>
)
reportWebVitals();