no message

This commit is contained in:
chenxuan
2024-04-16 14:51:08 +08:00
parent c9c1eb2e99
commit fe51a511a6
5 changed files with 27 additions and 4 deletions
-1
View File
@@ -38,7 +38,6 @@ class App extends Component{
</Switch>
</div>
</div>
)
}
}
+15 -2
View File
@@ -1,11 +1,24 @@
import React,{Comment} from "react";
import React from "react";
import {withRouter} from "react-router-dom";
class Head extends React.Component{
back=()=>{
this.props.history.goBack()
}
forward=()=>{
this.props.history.goForward()
}
go=()=>{
this.props.history.go(-2)
}
render(){
return(
<div className="head">
<h1>this is Hader</h1>
<button onClick={this.back}>返回</button>
<button onClick={this.forward}>前进</button>
<button onClick={this.go}>退后2步</button>
</div>
)
}
}
export default Head;
export default withRouter(Head)
+6
View File
@@ -26,5 +26,11 @@
}
.mainContainer .content .head {
box-sizing: border-box;
padding-bottom: 12px;
border-bottom: 1px solid #eee;
}
.mainContainer .content .head button {
margin-right: 12px;
}
+1 -1
View File
@@ -1 +1 @@
.mainContainer *{padding:0;margin:0;list-style:none}.mainContainer .nav{box-sizing:border-box;float:left;width:200px;height:100vh;padding:12px;border-right:1px solid #eee;display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}.mainContainer .nav .hehe{color:red}.mainContainer .content{margin-left:210px}.mainContainer .content .head{border-bottom:1px solid #eee}
.mainContainer *{padding:0;margin:0;list-style:none}.mainContainer .nav{box-sizing:border-box;float:left;width:200px;height:100vh;padding:12px;border-right:1px solid #eee;display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}.mainContainer .nav .hehe{color:red}.mainContainer .content{margin-left:210px}.mainContainer .content .head{box-sizing:border-box;padding-bottom:12px;border-bottom:1px solid #eee}.mainContainer .content .head button{margin-right:12px}
+5
View File
@@ -23,7 +23,12 @@
.content{
margin-left: 210px;
.head{
box-sizing: border-box;
padding-bottom: 12px;
border-bottom: 1px solid #eee;
button{
margin-right: 12px;
}
}
}
}