【发布时间】:2018-07-05 13:58:21
【问题描述】:
我有结构的 gitpage:
页面\
------其他页面-a\
-----------------index.html
------other-page-b\
-----------------index.html
------其他页面-c\
------------------- ...
静态\
资产清单.json\
favicon.ico\
index.html\
manifest.json\
service-worker.js\
主页是反应应用,但“页面”文件夹中的某些页面不是。
我尝试使用
进行重定向 <div
className="button"
onClick={() =>
(window.location.replace = https://stepanvanzuriak.github.io/pages/newspaper
)
}
>
但这不起作用,链接更改但页面没有
解决方案:弹出并删除SWPrecacheWebpackPlugin中的navigateFallback
【问题讨论】:
-
你试过 onClick={() => window.location.replace('whateverurl')} 吗?
-
@thsorens 是的,结果相同,链接更改但页面没有
-
@thsorens
div -
你在使用某种客户端路由器吗?
标签: javascript reactjs create-react-app