📜  从 next.js 路由获取参数 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:34.298000             🧑  作者: Mango

代码示例1
import {useRouter} from "next/router";

export default function Items() {
  const { query } = useRouter();
  return (
    

Items page

{query.id}

{query.name}

); }