(vue)点击按钮跳转到对应位置
按钮:
对应位置:
代码:
<el-button
type="primary"
round
class="button2"
@click="buttonClick('免费1V1咨询');startBtn()"
>免费1V1咨询</el-button>
//表单盒子
<div class="main-bottom">
...
</div>
//定位
startBtn() {
this.$el
.querySelector(".main-bottom")
.scrollIntoView({ block: "start", behavior: "smooth" });
},