Skip to content

Commit

Permalink
docs: make nz-code-box to skip hydration (#8513)
Browse files Browse the repository at this point in the history
  • Loading branch information
HyperLife1119 committed Apr 29, 2024
1 parent 5009ec0 commit 6c65aba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 4 additions & 6 deletions scripts/site/_site/doc/app/share/codebox/codebox.component.html
Expand Up @@ -15,11 +15,9 @@
</section>
<section class="code-box-meta markdown">
<div class="code-box-title">
<a (click)="navigateToFragment()"
>{{ nzTitle }}
<a class="edit-button" [attr.href]="nzHref" target="_blank" rel="noopener noreferrer">
<span nz-icon nzType="edit"></span>
</a>
<a (click)="navigateToFragment()">{{ nzTitle }}</a>
<a class="edit-button" [attr.href]="nzHref" target="_blank" rel="noopener noreferrer">
<span nz-icon nzType="edit"></span>
</a>
</div>
<div class="code-box-description">
Expand Down Expand Up @@ -118,4 +116,4 @@
</nz-highlight>
</div>
</section>
</section>
</section>
7 changes: 5 additions & 2 deletions scripts/site/_site/doc/app/share/codebox/codebox.component.ts
Expand Up @@ -22,7 +22,10 @@ import { OnlineIdeService } from '../../online-ide/online-ide.service';
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './codebox.component.html',
styleUrls: ['./codebox.component.less']
styleUrls: ['./codebox.component.less'],
host: {
ngSkipHydration: ''
}
})
export class NzCodeBoxComponent implements OnInit, OnDestroy {
highlightCode?: string;
Expand Down Expand Up @@ -146,7 +149,7 @@ export class NzCodeBoxComponent implements OnInit, OnDestroy {
private appService: AppService,
private platform: Platform,
private onlineIdeService: OnlineIdeService
) {}
) { }

ngOnInit(): void {
this.appService.theme$.pipe(takeUntil(this.destroy$)).subscribe(data => {
Expand Down

0 comments on commit 6c65aba

Please sign in to comment.