Fixed routing

feature/appm-store/pbac
jayasanka 6 years ago
parent 05d2e3dab5
commit 2a5cc97de9

@ -13,7 +13,8 @@
"antd": "^3.15.0",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-scripts": "2.1.8"
"react-scripts": "2.1.8",
"react-router-dom": "latest"
},
"devDependencies": {
"@babel/core": "^7.0.0",

@ -1,17 +1,19 @@
import React from "react";
import { version, Button } from 'antd';
import "antd/dist/antd.css";
import "./index.css";
import {BrowserRouter, Route, Switch} from 'react-router-dom';
import Dashboard from "./pages/dashboard"
import Login from "./pages/login"
class App extends React.Component {
render() {
return (
<div className="App">
<p>Current antd version: {version}</p>
<p>Please fork this codesandbox to reproduce your issue.</p>
<p> fork 这个链接来重现你碰到的问题</p>
<Button type="primary">Hello</Button>
</div>
<BrowserRouter>
<Switch>
<Route path="/publisher" component={Dashboard} exact/>
<Route path="/publisher/login" component={Login}/>
</Switch>
</BrowserRouter>
);
}
}

@ -0,0 +1,19 @@
import React from "react";
import { version, Button } from 'antd';
import {Link} from 'react-router-dom';
class Dashboard extends React.Component {
render() {
return (
<div className="App">
<p>Currentdddddd antd version: {version}</p>
<p>Please fork this codesandbox to reproduce your issue.</p>
<p> fork 这个链接来重现你碰到的问题</p>
<Link to="/login">login</Link>
<Button type="primary">Hello</Button>
</div>
);
}
}
export default Dashboard;

@ -0,0 +1,17 @@
import React from "react";
import { version, Button } from 'antd';
class Login extends React.Component {
render() {
return (
<div className="App">
<p>Current antd version: {version}</p>
<p>Please fork this codesandbox to reproduce your issue.</p>
<p> fork 这个链接来重现你碰到的问题</p>
<Button type="primary">Hello</Button>
</div>
);
}
}
export default Login;
Loading…
Cancel
Save