猿问

reactjs 部署到服务器,无法访问

请教个问题:现在已经有个H5项目部署在iis服务器,有个新需求我想用react redux去做。之前h5页面地址是:http://www.**.com/v100/a.html,新作的这个react页面要放在v101文件夹下,该怎么部署?怎么访问? 我试着把index.html和bundle.js放到了v101下,但是访问不了空白页。

慕工程0101907
浏览 447回答 1
1回答

茅侃侃

路由配置问题, 注意react router的跟路由, 要与浏览器地址了中的路径相匹配。ReactDom.render(<Provider store= { store }>&nbsp; &nbsp; <Router history = { history }>&nbsp; &nbsp; &nbsp; &nbsp; <Route path="/v100/a.html"> //假设服务器中的路由的react页面为/v100/a.html&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //... 子路由配置&nbsp; &nbsp; &nbsp; &nbsp; </Route>&nbsp; &nbsp; </Router></Provider>)
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答