最佳答案
当我点击我的 /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>
);