-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module:anchor): sync new properties (#7494)
- Loading branch information
Showing
13 changed files
with
225 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 4 | ||
title: | ||
zh-CN: 自定义锚点高亮 | ||
en-US: Customize the anchor highlight | ||
--- | ||
|
||
## zh-CN | ||
|
||
自定义锚点高亮。 | ||
|
||
## en-US | ||
|
||
Customize the anchor highlight. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-anchor-customize-highlight', | ||
template: ` | ||
<nz-anchor nzCurrentAnchor="#components-anchor-demo-static"> | ||
<nz-link nzHref="#components-anchor-demo-basic" nzTitle="Basic demo"></nz-link> | ||
<nz-link nzHref="#components-anchor-demo-static" nzTitle="Static demo"></nz-link> | ||
<nz-link nzHref="#api" nzTitle="API"> | ||
<nz-link nzHref="#nz-anchor" nzTitle="nz-anchor"></nz-link> | ||
<nz-link nzHref="#nz-link" nzTitle="nz-link"></nz-link> | ||
</nz-link> | ||
</nz-anchor> | ||
` | ||
}) | ||
export class NzDemoAnchorCustomizeHighlightComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 6 | ||
title: | ||
zh-CN: 监听锚点链接改变 | ||
en-US: Listening for anchor link change | ||
--- | ||
|
||
## zh-CN | ||
|
||
监听锚点链接改变 | ||
|
||
## en-US | ||
|
||
Listening for anchor link change. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-anchor-on-change', | ||
template: ` | ||
<nz-anchor (nzChange)="handleChange($event)"> | ||
<nz-link nzHref="#components-anchor-demo-basic" nzTitle="Basic demo"></nz-link> | ||
<nz-link nzHref="#components-anchor-demo-static" nzTitle="Static demo"></nz-link> | ||
<nz-link nzHref="#api" nzTitle="API"> | ||
<nz-link nzHref="#nz-anchor" nzTitle="nz-anchor"></nz-link> | ||
<nz-link nzHref="#nz-link" nzTitle="nz-link"></nz-link> | ||
</nz-link> | ||
</nz-anchor> | ||
` | ||
}) | ||
export class NzDemoAnchorOnChangeComponent { | ||
handleChange(link: string): void { | ||
console.log('Anchor:OnChange', link); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 3 | ||
title: | ||
zh-CN: 自定义 onClick 事件 | ||
en-US: Customize the onClick event | ||
--- | ||
|
||
## zh-CN | ||
|
||
点击锚点不记录历史。 | ||
|
||
## en-US | ||
|
||
Clicking on an anchor does not record history. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-anchor-on-click', | ||
template: ` | ||
<nz-anchor (nzClick)="handleClick($event)"> | ||
<nz-link nzHref="#components-anchor-demo-basic" nzTitle="Basic demo"></nz-link> | ||
<nz-link nzHref="#components-anchor-demo-static" nzTitle="Static demo"></nz-link> | ||
<nz-link nzHref="#api" nzTitle="API"> | ||
<nz-link nzHref="#nz-anchor" nzTitle="nz-anchor"></nz-link> | ||
<nz-link nzHref="#nz-link" nzTitle="nz-link"></nz-link> | ||
</nz-link> | ||
</nz-anchor> | ||
` | ||
}) | ||
export class NzDemoAnchorOnClickComponent { | ||
handleClick(e: string): void { | ||
console.log(e); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 5 | ||
title: | ||
zh-CN: 设置锚点滚动偏移量 | ||
en-US: Set Anchor scroll offset | ||
--- | ||
|
||
## zh-CN | ||
|
||
锚点目标滚动到屏幕正中间。 | ||
|
||
## en-US | ||
|
||
Anchor target scroll to screen center. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-anchor-target-offset', | ||
template: ` | ||
<nz-anchor [nzTargetOffset]="targetOffset"> | ||
<nz-link nzHref="#components-anchor-demo-basic" nzTitle="Basic demo"></nz-link> | ||
<nz-link nzHref="#components-anchor-demo-static" nzTitle="Static demo"></nz-link> | ||
<nz-link nzHref="#api" nzTitle="API"> | ||
<nz-link nzHref="#nz-anchor" nzTitle="nz-anchor"></nz-link> | ||
<nz-link nzHref="#nz-link" nzTitle="nz-link"></nz-link> | ||
</nz-link> | ||
</nz-anchor> | ||
` | ||
}) | ||
export class NzDemoAnchorTargetOffsetComponent implements OnInit { | ||
targetOffset?: number; | ||
|
||
ngOnInit(): void { | ||
this.targetOffset = window.innerHeight / 2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters