-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71b70bd
commit f29c120
Showing
14 changed files
with
533 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import React,{Component} from "react"; | ||
import React, { Component } from "react"; | ||
|
||
import "styles/common.css"; | ||
import "styles/reset.css" | ||
import "styles/reset.css"; | ||
export default class App extends Component { | ||
componentDidMount() { | ||
|
||
} | ||
render(){ | ||
return ( | ||
<div className="container"> | ||
{this.props.children} | ||
</div> | ||
); | ||
componentDidMount() {} | ||
render() { | ||
return <div className="container">{this.props.children}</div>; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React, { Component } from 'react' | ||
|
||
export default class Footer extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
Footer | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React, { Component } from 'react' | ||
import "./index.scss" | ||
export default class Header extends Component { | ||
render() { | ||
return ( | ||
<div className="header"> | ||
123 | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.header{ | ||
height: 86px; | ||
background-color: red; | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
right: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React, { Component } from "react"; | ||
import Header from "@/components/header"; | ||
import Footer from "@/components/footer"; | ||
import "./index.scss" | ||
export default class Common extends Component { | ||
render() { | ||
return ( | ||
<div className="common"> | ||
<div className="common-center"> | ||
<Header /> | ||
{this.props.children} | ||
<Footer /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.common { | ||
.common-center { | ||
position: relative; | ||
width: 1080px; | ||
margin: 0 auto; | ||
overflow: hidden; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.home{ | ||
.home-banner{ | ||
height: 640px; | ||
background-color: orange; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React, { Component } from 'react' | ||
|
||
export default class Login extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
Login | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React, { Component } from 'react' | ||
|
||
export default class NoMatch extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
404 not found | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
import React, { Component } from 'react' | ||
import {BrowserRouter,Route,Switch} from "react-router-dom" | ||
import App from "../App" | ||
import Login from "@/pages/login" | ||
import Home from "@/pages/home" | ||
import React, { Component } from "react"; | ||
import { BrowserRouter, Route, Switch, Redirect } from "react-router-dom"; | ||
import App from "../App"; | ||
import Login from "@/pages/login"; | ||
import Common from "@/pages/common"; | ||
import Home from "@/pages/home"; | ||
import Nomatch from "@/pages/nomatch"; | ||
export default class Rouer extends Component { | ||
render() { | ||
return ( | ||
<BrowserRouter> | ||
<App> | ||
<Switch> | ||
<Rouer path="/login" component={Login} /> | ||
<Route path="/" component={Home} /> | ||
<Route path="/login" component={Login} /> | ||
<Route | ||
path="/" | ||
render={() => ( | ||
<Common> | ||
<Switch> | ||
<Route path="/home" component={Home} /> | ||
<Redirect to="/home" /> | ||
<Route component={Nomatch} /> | ||
</Switch> | ||
</Common> | ||
)} | ||
/> | ||
</Switch> | ||
</App> | ||
</BrowserRouter> | ||
) | ||
); | ||
} | ||
} |
Oops, something went wrong.