在
next.js你可以通过这样的查询参数
Router.push({ pathname: '/about', query: { name: 'Someone' }})然后在你的下一个页面(在此
/about页),检索
query通过
router道具,需要被注入到
Component使用
withRouter。
import { withRouter } from 'next/router'class about extends React.Component { // your Component implementation // retrieve them like this // this.props.router.query.name}export default withRouter(about)


