You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

17 lines
411 B

import { useSearchParams } from 'react-router-dom'
function About () {
const [params] = useSearchParams()
/**
* params 是一个对象,对象里有一个 get 的方法,用来获取对应的参数,把参数的名称作为 get 方法的实参传过来
*/
const id = params.get('id')
return (
<div>About得到的参数 id 值为 {id}</div>
)
}
export default About