[英]Why when i scroll top my page and click link which append a form it scroll me down
[英]Perfectly scroll to top. but when i scroll down and click anywhere on page, again scroll moves to the top
这是我的代码。 呈现页面时效果很好,但是当我在某处单击时会变为顶部
ngAfterViewChecked() {
// this.mainPageComponent.rightPanel.nativeElement.scrollTo(0, 0);
this.element.nativeElement.scrollIntoView();
}
每次在angular检查组件视图后都会触发ngAfterViewChecked。
如果希望仅在初始化时触发此效果,则应使用ngOnInit。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.