'$route': { // $route可以用引号,也可以不用引号 监听的对象
handler(to, from){
if(to.fullPath!=from.fullPath){
//randomCode是生成的毫秒数只有点击跳转的时候带了这个参数 if(this.$route.query.randomCode){
// this.dataContent1.scrollIntoView({ block: "start", behavior: "smooth" });
window.location.hash = "#sectioData";
}
}
},
// deep: true, // 深度观察监听 设置为 true
// immediate: true, // 第一次初始化渲染就可以监听到
},
<div class="data-content" id="sectioData"></div>