Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问routes/app.js文件中children值是怎么设置的? #24

Closed
190589751 opened this issue Jan 7, 2017 · 4 comments
Closed

请问routes/app.js文件中children值是怎么设置的? #24

190589751 opened this issue Jan 7, 2017 · 4 comments

Comments

@190589751
Copy link

你好, 请问routes/app.js文件中children值是怎么设置的?

@zuiidea
Copy link
Owner

zuiidea commented Jan 7, 2017

請看src/router.js

@190589751
Copy link
Author

@zuiidea 看过愣是没看懂,请指教...

@zuiidea
Copy link
Owner

zuiidea commented Jan 9, 2017

<Router history={hashHistory}>
  <Route path="/" component={App}>
    <Route path="/dashboard" component={Dashboard}/>
    <Route path="/users" component={Users}/>
  </Route>
</Router>

這是路由嵌套,子路由就是父路由的children,
src/router.js裏為了實現動態加載,采用了參數的寫法

參考
https://github.com/ReactTraining/react-router
http://www.ruanyifeng.com/blog/2016/05/react_router.html?utm_source=tool.lu

@zuiidea zuiidea closed this as completed Jan 18, 2017
@zhangolve
Copy link

谢谢楼主提这个问题,也谢谢 @zuiidea ,正想问这个问题呢,一搜果然有人问了。项目代码还是很简洁清晰的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants