vue想要达到可以局部运行每个组件,运行出来不显示内容,也没有报错,有人能帮忙解答一下吗?
【相关推荐】
showSearch() {
// 获取当前滚动条向下滚动的距离
let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
// 当页面滚动到高度300px处时,显示搜索框
if (scrollTop > 300) {
this.showFixedSearch = true;
} else {
this.showFixedSearch = false;
}
},
在router的index中设置路由了吗?