最佳答案
当我点击我的 /index.js链接,它带我到 /about.js页面。
但是,当我将参数名称通过 URL (如 关于? 名字 = leangchhean)从 /index.js传递到 /about.js时,我不知道如何在 /about.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>
);