提交 d4bc8de6 编写于 作者: X xjh22222228

fix: side marginTop

上级 2ee82436
......@@ -32,6 +32,7 @@ $sideWidth: 200px;
.box {
flex: 1;
transition: .1s linear;
}
}
......
......@@ -32,7 +32,7 @@ export default class HomeComponent {
openIndex = queryString().page
contentEl: HTMLElement
searchEngineList = searchEngineList
marginTop: number = 50
marginTop: number = 60
constructor (private router: Router, private activatedRoute: ActivatedRoute) {}
......@@ -64,11 +64,13 @@ export default class HomeComponent {
})
}
ngAfterViewInit() {
ngAfterContentInit() {
window.addEventListener('scroll', this.scroll)
const headerEl = document.querySelector('.search-header')
this.marginTop = headerEl.clientHeight
setTimeout(() => {
const headerEl = document.querySelector('.search-header')
this.marginTop = headerEl.clientHeight
}, 26)
}
ngOnDestroy() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册