react-router(不同组件之间传递路由)
- 图解:
- 代码:
// less require ('./static/less/index.less') // 核心 var React = require('react') var ReactDom = require('react-dom') var ReactRouter = require('react-router-dom') var Router = ReactRouter.BrowserRouter var Route = ReactRouter.Route var Link = ReactRouter.Link var CreateClass = require('create-react-class') var PropTypes = require('prop-types') var ajax = require('dollarphpajax') // 组件 var Index = CreateClass({ render:function(){ return (
- main
- 1
- 2
main
) } }) var Content_1 = CreateClass({ render:function(){ return (1
) } }) var Content_2 = CreateClass({ render:function(){ return (2
) } }) // 渲染 ReactDom.render(名称栏目:react-router(不同组件之间传递路由)
网页路径:http://scyanting.com/article/jggcod.html