• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

描述:向路径添加前缀。访问完页面,刷新页面,样式就没了。

原因:页面刷新后,在获取样式的URL中有一个手动添加的路径前缀,但是在获取样式的URL中没有这个前缀,导致样式丢失。

正确情况下的样式路径:

o3n22a03vpm5192.png

出错时的样式路径

in544vuwc5d5193.png

解决方案1:

在脚手架的公共文件夹中修改导入样式在index.html的路径。

link rel='样式表' href='。/css/bootstrap.css' /

替换为:

link rel=' style sheet ' href='/CSS/bootstrap . CSS '/

解决方案2:

link rel=' style sheet ' href=' % PUBLIC _ URL %/CSS/bootstrap . CSS '/

解决方案3:

const root=react DOM . create root(document . getelementbyid(' root '));

root.render(

HashRouterApp //HashRouter

);

Link to comment
Share on other sites