1
- import { Component } from '@angular/core' ;
1
+ import { Component , OnInit } from '@angular/core' ;
2
2
3
3
@Component ( {
4
4
selector : 'nz-demo-list-vertical' ,
@@ -7,37 +7,50 @@ import { Component } from '@angular/core';
7
7
[nzDataSource]="data"
8
8
[nzItemLayout]="'vertical'"
9
9
[nzRenderItem]="item"
10
- [nzPagination]="pagination">
11
- <ng-template #item let-item>
12
- <nz-list-item [nzContent]="item.content" [nzActions]="[starAction,likeAction,msgAction]" [nzExtra]="extra">
13
- <ng-template #starAction><i nz-icon type="star-o" style="margin-right: 8px;"></i> 156</ng-template>
14
- <ng-template #likeAction><i nz-icon type="like-o" style="margin-right: 8px;"></i> 156</ng-template>
15
- <ng-template #msgAction><i nz-icon type="message" style="margin-right: 8px;"></i> 2</ng-template>
16
- <nz-list-item-meta
17
- [nzAvatar]="item.avatar"
18
- [nzTitle]="nzTitle"
19
- [nzDescription]="item.description">
20
- <ng-template #nzTitle><a href="{{item.href}}">{{item.title}}</a></ng-template>
21
- </nz-list-item-meta>
22
- <ng-template #extra>
23
- <img width="272" alt="logo" src="https://gw.alipayobjects.com/zos/rmsportal/mqaQswcyDLcXyDKnZfES.png">
24
- </ng-template>
25
- </nz-list-item>
26
- </ng-template>
27
- <ng-template #pagination>
28
- <nz-pagination [nzPageIndex]="1" [nzTotal]="50"></nz-pagination>
29
- </ng-template>
10
+ [nzPagination]="pagination"
11
+ [nzFooter]="footer">
12
+ <ng-template #item let-item>
13
+ <nz-list-item [nzContent]="item.content" [nzActions]="[starAction,likeAction,msgAction]" [nzExtra]="extra">
14
+ <ng-template #starAction><i nz-icon type="star-o" style="margin-right: 8px;"></i> 156</ng-template>
15
+ <ng-template #likeAction><i nz-icon type="like-o" style="margin-right: 8px;"></i> 156</ng-template>
16
+ <ng-template #msgAction><i nz-icon type="message" style="margin-right: 8px;"></i> 2</ng-template>
17
+ <nz-list-item-meta
18
+ [nzAvatar]="item.avatar"
19
+ [nzTitle]="nzTitle"
20
+ [nzDescription]="item.description">
21
+ <ng-template #nzTitle><a href="{{item.href}}">{{item.title}}</a></ng-template>
22
+ </nz-list-item-meta>
23
+ <ng-template #extra>
24
+ <img width="272" alt="logo" src="https://gw.alipayobjects.com/zos/rmsportal/mqaQswcyDLcXyDKnZfES.png">
25
+ </ng-template>
26
+ </nz-list-item>
27
+ </ng-template>
28
+ <ng-template #footer>
29
+ <div><b>ant design</b> footer part</div>
30
+ </ng-template>
31
+ <ng-template #pagination>
32
+ <nz-pagination [nzPageIndex]="1" [nzTotal]="50" (nzPageIndexChange)="loadData($event)"></nz-pagination>
33
+ </ng-template>
30
34
</nz-list>
31
35
`
32
36
} )
33
- export class NzDemoListVerticalComponent {
34
- data = new Array ( 5 ) . fill ( { } ) . map ( ( i , index ) => {
35
- return {
36
- href : 'http://ant.design' ,
37
- title : `ant design part ${ index } ` ,
38
- avatar : 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png' ,
39
- description : 'Ant Design, a design language for background applications, is refined by Ant UED Team.' ,
40
- content : 'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.'
41
- } ;
42
- } ) ;
37
+ export class NzDemoListVerticalComponent implements OnInit {
38
+ // tslint:disable-next-line:no-any
39
+ data : any [ ] = [ ] ;
40
+
41
+ ngOnInit ( ) : void {
42
+ this . loadData ( 1 ) ;
43
+ }
44
+
45
+ loadData ( pi : number ) : void {
46
+ this . data = new Array ( 5 ) . fill ( { } ) . map ( ( i , index ) => {
47
+ return {
48
+ href : 'http://ant.design' ,
49
+ title : `ant design part ${ index } (page: ${ pi } )` ,
50
+ avatar : 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png' ,
51
+ description : 'Ant Design, a design language for background applications, is refined by Ant UED Team.' ,
52
+ content : 'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.'
53
+ } ;
54
+ } ) ;
55
+ }
43
56
}
0 commit comments