8 |
alert('Home click')}>
9 | Home, This is wbh's ssr demo
10 |
11 |
跳转到 text
12 |
13 | )
14 | }
15 | export default Home
--------------------------------------------------------------------------------
/ssr-react/src/index.css:
--------------------------------------------------------------------------------
1 | .wrapper {
2 | background: orange;
3 | }
4 |
5 | .title {
6 | color: red;
7 | font-size: 26px;
8 | }
--------------------------------------------------------------------------------
/ssr-react/src/router.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Route, Redirect, Switch} from 'react-router';
3 | import Home from './home'
4 | import Text from './text'
5 |
6 |
7 | const routers = [
8 | {
9 | type: 'route',
10 | path: '/',
11 | component: Home,
12 | exact: true
13 | },
14 | {
15 | type: 'route',
16 | path: 'text',
17 | component: Text,
18 | exact: true
19 | }
20 | ]
21 |
22 | export default (