【发布时间】:2019-01-21 09:51:55
【问题描述】:
我使用路由 next.js。如何实现按钮返回和返回上一页?就像浏览器上的按钮一样
【问题讨论】:
-
您可能需要查看Next.js getting started 页面。
-
查看但没有找到解决方案。我试图这样做,但得到了不断的页面重定向。 export const BackUrl = ({url}) => (
Nazad
) -
Client-Side History Support 状态:
When you hit the Back button, it navigates the page to the index page entirely via the client; next/link does all the location.history handling for you.You don't need to write even a single line of client-side routing code.。所以你不需要onClick属性和window.history.back()