当我点击index.js中的链接时,它会将我带到about.js页面.当我通过url从index.js传递参数名称到about.js,我不知道如何在about.js页面中获取它.
我在index.js中的代码:
import Link from 'next/link'
export default () => (
<div>Click <Link href={{ pathname: 'about', query: { name: 'leangchhean' }}}><a>here</a></Link> to read more</div>
)
Run Code Online (Sandbox Code Playgroud)
next.js ×1