我正在尝试将从 reactstrap 导入的按钮链接到我页面上的特定部分。我尝试了许多不同的解决方案,但它们似乎都不起作用。 这是现在的样子:
2. import { Button, Card, CardBody, CardTitle, Row, Col, CardImg, CardText } from 'reactstrap';
...
...
23. <Button href="#jump">Thrift shops</Button>
...
...
69. <h5 id="jump">Near city center</h5>
所以我试图从第 23 行使用的按钮跳转到第 69 行。我迷路了......
最佳答案
Button
不支持 href
属性。您需要使用 <a>
标记为即
<a href="#jump">Thrift shops</a>
关于reactjs - Reactstrap 按钮链接到同一页面上的部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64550539/