Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nav): nav support responsive #1273

Merged
merged 4 commits into from
Jul 12, 2021
Merged

Conversation

luxiaobei
Copy link
Contributor

No description provided.


public moreActive: boolean;

@ContentChildren(ThyNavLinkDirective, { descendants: true }) tabs: QueryList<ThyNavLinkDirective>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 tabs 改一个名字,叫 links 或者 navLinks

Comment on lines 150 to 152
this.ngZone.onStable.pipe(takeUntil(this.ngUnsubscribe$)).subscribe(() => {
this.calculateMoreIsActive();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方订阅计算更多是否激活是不是太频繁了,使用 ngAfterContentChecked 或者 ngAfterViewChecked 钩子中检查可以吗?

Comment on lines 60 to 64
this.width = this.elementRef.nativeElement.offsetWidth;
this.height = this.elementRef.nativeElement.offsetHeight;
this.left = this.elementRef.nativeElement.offsetLeft;
this.top = this.elementRef.nativeElement.offsetTop;
this.content = this.elementRef.nativeElement.outerHTML;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议直接使用一个 offset 的 get 访问器返回 width,height,left,top 等数据,不要通过变量保存起来

@luxiaobei luxiaobei merged commit 4af8f26 into master Jul 12, 2021
@luxiaobei luxiaobei deleted the luxiaobei/feat-nav-responsive branch July 12, 2021 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants