react 怎么实现同一个页面内锚点导航

2025-04-30 10:46:18
推荐回答(1个)
回答1:

点开文章的时候就重写每个锚点的id啊,
替换成路由地址加锚点值,id=location.hash+id;
即可。