Skip to content

Commit dbcf782

Browse files
authored
docs: update faq doc (#2993)
1 parent b33fe7a commit dbcf782

12 files changed

Lines changed: 97 additions & 751 deletions

File tree

components/list/demo/infinite-load.ts

Lines changed: 48 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,55 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
55
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
66

77
@Component({
8-
selector: 'nz-demo-list-infinite-load',
9-
template: `
10-
<div>
11-
<cdk-virtual-scroll-viewport
12-
itemSize="73"
13-
class="demo-infinite-container"
14-
>
15-
<nz-list>
16-
<nz-list-item *cdkVirtualFor="let item of ds">
17-
<nz-skeleton
18-
*ngIf="!item"
19-
[nzAvatar]="true"
20-
[nzParagraph]="{ rows: 1 }"
21-
></nz-skeleton>
22-
<nz-list-item-meta
23-
*ngIf="item"
24-
[nzTitle]="nzTitle"
25-
nzAvatar="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
26-
[nzDescription]="item.email"
27-
>
28-
<ng-template #nzTitle>
29-
<a href="https://ng.ant.design">{{item.name.last}}</a>
30-
</ng-template>
31-
</nz-list-item-meta>
32-
</nz-list-item>
33-
</nz-list>
34-
</cdk-virtual-scroll-viewport>
35-
</div>
8+
selector : 'nz-demo-list-infinite-load',
9+
template : `
10+
<div>
11+
<cdk-virtual-scroll-viewport
12+
itemSize="73"
13+
class="demo-infinite-container"
14+
>
15+
<nz-list>
16+
<nz-list-item *cdkVirtualFor="let item of ds">
17+
<nz-skeleton
18+
*ngIf="!item"
19+
[nzAvatar]="true"
20+
[nzParagraph]="{ rows: 1 }"
21+
></nz-skeleton>
22+
<nz-list-item-meta
23+
*ngIf="item"
24+
[nzTitle]="nzTitle"
25+
nzAvatar="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
26+
[nzDescription]="item.email"
27+
>
28+
<ng-template #nzTitle>
29+
<a href="https://ng.ant.design">{{item.name.last}}</a>
30+
</ng-template>
31+
</nz-list-item-meta>
32+
</nz-list-item>
33+
</nz-list>
34+
</cdk-virtual-scroll-viewport>
35+
</div>
3636
`,
37-
styles: [
38-
`
37+
styles : [
38+
`
3939
.demo-infinite-container {
4040
height: 300px;
4141
border: 1px solid #e8e8e8;
4242
border-radius: 4px;
4343
}
44+
45+
nz-list {
46+
padding: 24px;
47+
}
4448
`
4549
],
4650
changeDetection: ChangeDetectionStrategy.OnPush
4751
})
4852
export class NzDemoListInfiniteLoadComponent {
4953
ds = new MyDataSource(this.http);
5054

51-
constructor(private http: HttpClient) {}
55+
constructor(private http: HttpClient) {
56+
}
5257
}
5358

5459
class MyDataSource extends DataSource<string | undefined> {
@@ -91,18 +96,18 @@ class MyDataSource extends DataSource<string | undefined> {
9196
this.fetchedPages.add(page);
9297

9398
this.http
94-
.get(
95-
`https://randomuser.me/api/?results=${
96-
this.pageSize
99+
.get(
100+
`https://randomuser.me/api/?results=${
101+
this.pageSize
97102
}&inc=name,gender,email,nat&noinfo`
98-
)
99-
.subscribe((res: any) => {
100-
this.cachedData.splice(
101-
page * this.pageSize,
102-
this.pageSize,
103-
...res.results
104-
);
105-
this.dataStream.next(this.cachedData);
106-
});
103+
)
104+
.subscribe((res: any) => {
105+
this.cachedData.splice(
106+
page * this.pageSize,
107+
this.pageSize,
108+
...res.results
109+
);
110+
this.dataStream.next(this.cachedData);
111+
});
107112
}
108113
}

components/modal/doc/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The dialog is currently divided into 2 modes, `normal mode` and `confirm box mod
3939
| nzMask | Whether show mask or not. | `boolean` | `true` |
4040
| nzMaskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | `boolean` | `true` |
4141
| nzMaskStyle | Style for modal's mask element. | `object` | - |
42-
| nzOkText | Text of the OK button. <i>Set to null to show no cancel button (this value is invalid if the nzFooter parameter is used in normal mode)</i> | `string` | OK |
42+
| nzOkText | Text of the OK button. <i>Set to null to show no ok button (this value is invalid if the nzFooter parameter is used in normal mode)</i> | `string` | OK |
4343
| nzOkType | Button type of the OK button. <i>Consistent with the type of the `nz-button`.</i> | `string` | primary |
4444
| nzStyle | Style of floating layer, typically used at least for adjusting the position. | `object` | - |
4545
| nzTitle | The modal dialog's title. <i>Leave blank to show no title. The usage of TemplateRef can refer to the case</i> | string / TemplateRef | - |

components/modal/doc/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ title: Modal
4040
| nzMask | 是否展示遮罩 | `boolean` | `true` |
4141
| nzMaskClosable | 点击蒙层是否允许关闭 | `boolean` | `true` |
4242
| nzMaskStyle | 遮罩样式 | `object` | - |
43-
| nzOkText | 确认按钮文字。<i>设为 null 表示不显示取消按钮(若在普通模式下使用了 nzFooter 参数,则该值无效)</i> | `string` | 确定 |
43+
| nzOkText | 确认按钮文字。<i>设为 null 表示不显示确认按钮(若在普通模式下使用了 nzFooter 参数,则该值无效)</i> | `string` | 确定 |
4444
| nzOkType | 确认按钮类型。<i>与button的type类型值一致</i> | `string` | primary |
4545
| nzStyle | 可用于设置浮层的样式,调整浮层位置等 | `object` | - |
4646
| nzTitle | 标题。<i>留空表示不展示标题。TemplateRef的使用方法可参考案例</i> | string<br>TemplateRef | - |

0 commit comments

Comments
 (0)