1.目标页面设置锚点及跳转事件
<p id="demoAnchor">直播时间:2021年10月20日</p>
methods:{
open(){
window.location.href = '#demoAnchor';
}
},
mounted(){
if(this.$route.query.active){
this.open();
}
2.准备跳转页面,设置跳转,传过去一个参数
<router-link to="/activity?active=demoAnchor" class="rules">比赛规则</router-link>