Created
June 13, 2017 10:31
-
-
Save nojaja/f59c05ee5200bd873247d5a302d07bed to your computer and use it in GitHub Desktop.
react-router v4
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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title></title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.12.0/css/uikit.min.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script src="https://code.jquery.com/jquery-migrate-3.0.0.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-router-dom/4.1.1/react-router-dom.min.js"></script> | |
<script > | |
const {BrowserRouter,HashRouter, Switch, Route, Link} = ReactRouterDOM | |
</script> | |
</head> | |
<body> | |
<BrowserRouter> | |
<div> | |
<div className="nav"> | |
<Link to="/home">home</Link> | |
<Link to="/about">about</Link> | |
</div> | |
<Route path="/home" component={PageHome} /> | |
<Route path="/about" component={PageAbout} /> | |
</div> | |
</BrowserRouter> | |
<element name="Page-Home"> | |
<template> | |
<div>home</div> | |
</template> | |
</element> | |
<element name="Page-About"> | |
<template> | |
<div>About</div> | |
</template> | |
</element> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment