react-router(不同组件之间传递路由)

  1. 图解:
    react-router(不同组件之间传递路由)
    react-router(不同组件之间传递路由)
    react-router(不同组件之间传递路由)
    react-router(不同组件之间传递路由)
  2. 代码:
    // 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 (
            
                
    ) } }) var Head = CreateClass({ render:function(){ return (
    • main
    • 1
    • 2
    ) } }) var Content = CreateClass({ render:function(){ return (
    ) } }) var Content_main = CreateClass({ render:function(){ return (

    main

    ) } }) var Content_1 = CreateClass({ render:function(){ return (

    1

    ) } }) var Content_2 = CreateClass({ render:function(){ return (

    2

    ) } }) // 渲染 ReactDom.render( , document.getElementById('app') )
  3. 效果:
    react-router(不同组件之间传递路由)
    react-router(不同组件之间传递路由)
    react-router(不同组件之间传递路由)

名称栏目:react-router(不同组件之间传递路由)
网页路径:http://scyanting.com/article/jggcod.html