/**
* <Route path="/" component={Core}>
* <IndexRoute component={Home}/>
* <Route path="about" component={About}/>
* <Route path="users" component={Users}>
* <Route path="*" component={Home}/>
* </Route>
*/
export default {
path: '/',
component: Core,
indexRoute: {
getComponent(location, cb) {
...
},
},
childRoutes: [
{
path: 'about',
getComponent(location, cb) {
...
},
},
{
path: 'users',
getComponent(location, cb) {
...
},
},
{
path: '*',
getComponent(location, cb) {
...
},
},
],
};
import IndexPage from './views/app.jsx'
import AboutPage from './views/about.jsx'
export default function({history}) {
return (
<Router history={history}>
<Route path="/" component={IndexPage} />
<Route path="/about" component={AboutPage} />
</Router>
)
}
export default function({history}) {
return (
<Router history={history}>
<Route path="/" getComponent={(location, callback) => {
require.ensure([], function(require) {
callback(null, require('./HomePage.jsx'))
})
}} />
<Route path="/about" getComponent={(location, callback) => {
require.ensure([], function(require) {
callback(null, require('./AboutPage.jsx'))
})
}} />
</Router>
)
}
const home = (location, callback) => {
require.ensure([], require => {
callback(null, require('./HomePage.jsx'))
}, 'home')
}
const about = (location, callback) => {
require.ensure([], require => {
callback(null, require('./AboutPage.jsx'))
}, 'about')
}
export default function({history}) {
return (
<Router history={history}>
<Route path="/" getComponent={home}></Route>
<Route path="/about" getComponent={about}></Route>
</Router>
)
}
export default function({history}) {
return (
<Router history={history}>
<Route path="/" getComponent={(location, callback) => {
System.import('./HomePage.jsx').then(component => {
callback(null, component.default || component)
})
}} />
<Route path="/about" getComponent={(location, callback) => {
System.import('./AboutPage.jsx').then(component => {
callback(null, component.default || component)
})
}} />
</Router>
)
}
const home = (location, callback) => {
System.import('./HomePage.jsx').then(component => {
callback(null, component.default || component)
})
}
const about = (location, callback) => {
System.import('./AboutPage.jsx').then(component => {
callback(null, component.default || component)
})
}
export default ({ history }) => {
return (
<Router history={history}>
<Route name="home" path="/" getComponent={home} />
<Route name="about" path="/about" getComponent={about} />
</Router>
)
}
const routerThen = (app, callback, [component, model]) => {
app.model(model.default || model)
callback(null, component.default || component)
}
export default ({ history, app }) => {
return (
<Router history={history}>
<Route name="home" path="/" getComponent={(location, callback) => {
Promise.all([
System.import('./views/app.jsx'),
System.import('./models/topics')
]).then(routerThen.bind(null, app, callback))
}} />
<Route name="article" path="/article/:id" getComponent={(location, callback) => {
Promise.all([
System.import('./views/article.jsx'),
System.import('./models/topic')
]).then(routerThen.bind(null, app, callback))
}} />
</Router>
)
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有