文章目录
需要使用 Router: https://nextjs.org/docs/api-reference/next/router#router-object
router object
- pathname: String - Current route. That is the path of the page in /pages
- query: Object - The query string parsed to an object. Defaults to {}
- asPath: String - Actual path (including the query) shown in the browser
1 | import {useRouter} from 'next/router' |