将反应应用程序上传到gh页后,仅显示背景. [英] After uploading a react app to gh-pages, only the background is showing up.
本文介绍了将反应应用程序上传到gh页后,仅显示背景.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我以与过去相同的方式将项目上传到gh-pages,由于某种原因,仅显示背景图像.任何帮助,将不胜感激.
I uploaded the project to gh-pages the same way I have in the past and for some reason only the background image is showing. Any help would be appreciated.
https://github.com/jellis720/adoboJoeMockup
推荐答案
在您的 package.json
中,您必须将 homepage
设置为提供服务的确切路径指定的应用
In your package.json
, you must set homepage
to the exact path where you are serving your app as specified here. In your case, it should be :
"homepage": "https://jellis720.github.io/adoboJoeMockup"
和不是:
"homepage": "https://jellis720.github.io/adobojoemockup"
您还可能需要为 BrowserRouter
设置 basename
,选中
You'll also likely need to set the basename
for BrowserRouter
, check this
这篇关于将反应应用程序上传到gh页后,仅显示背景.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文