wd2010 / React-universal-ssr

webpack3+router4+按需加载+webpack-dev-server热加载
69 stars 18 forks source link

这个项目会持续维护和更新吗? #3

Open dxhuii opened 6 years ago

dxhuii commented 6 years ago

如题。

wd2010 commented 6 years ago

会的,项目结构要更改下,还有报错上报的后续会加上,只是现在在忙其他的,谢谢关注

dxhuii commented 6 years ago

@wd2010 想问怎么加上NProgress这个,我测试了,没有加上去,放componentWillMount和componentDidMount里面会报错。报document没有定义。原生路由没有像nextjs

Router.onRouteChangeStart = (url) => {
  console.log(`Loading: ${url}`)
  NProgress.start()
}
Router.onRouteChangeComplete = () => NProgress.done()
Router.onRouteChangeError = () => NProgress.done()

这样的功能。

wd2010 commented 6 years ago

没有用过nextjs,这个我也不太清楚了,但感觉是服务器跑了前端里面的东西导致document报错了

dxhuii commented 6 years ago

@wd2010 那有没有什么办法实现切换路由的时候,显示加载进度条的效果。