-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
87 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 0 | ||
order: 1 | ||
title: | ||
zh-CN: 基础列表样例 | ||
en-US: Basic List Sample | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1 | ||
order: 0 | ||
title: | ||
zh-CN: 卡片样例 | ||
en-US: Card Sample | ||
|
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: 2 | ||
title: | ||
zh-CN: 列表样例 | ||
en-US: List Sample | ||
--- | ||
|
||
## zh-CN | ||
|
||
在列表组件中使用加载占位符。 | ||
|
||
## en-US | ||
|
||
Use skeleton in list component. |
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,40 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-skeleton-list', | ||
template: ` | ||
<nz-switch [(ngModel)]="loading"></nz-switch> | ||
<nz-list [nzDataSource]="listData" [nzRenderItem]="item" [nzItemLayout]="'vertical'"> | ||
<ng-template #item let-item> | ||
<nz-list-item [nzContent]="loading?'':item.content" [nzActions]="loading?[]:[starAction,likeAction,msgAction]" [nzExtra]="loading?'':extra"> | ||
<nz-skeleton [nzLoading]="loading"> | ||
<ng-template #starAction><i class="anticon anticon-star-o" style="margin-right: 8px;"></i> 156</ng-template> | ||
<ng-template #likeAction><i class="anticon anticon-like-o" style="margin-right: 8px;"></i> 156</ng-template> | ||
<ng-template #msgAction><i class="anticon anticon-message" style="margin-right: 8px;"></i> 2</ng-template> | ||
<nz-list-item-meta | ||
[nzAvatar]="item.avatar" | ||
[nzTitle]="nzTitle" | ||
[nzDescription]="item.description"> | ||
<ng-template #nzTitle><a href="{{item.href}}">{{item.title}}</a></ng-template> | ||
</nz-list-item-meta> | ||
<ng-template #extra> | ||
<img width="272" alt="logo" src="https://gw.alipayobjects.com/zos/rmsportal/mqaQswcyDLcXyDKnZfES.png"> | ||
</ng-template> | ||
</nz-skeleton> | ||
</nz-list-item> | ||
</ng-template> | ||
</nz-list> | ||
` | ||
}) | ||
export class NzDemoSkeletonListComponent { | ||
loading = true; | ||
listData = new Array(3).fill({}).map((i, index) => { | ||
return { | ||
href: 'http://ng.ant.design', | ||
title: `ant design part ${index}`, | ||
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', | ||
description: 'Ant Design, a design language for background applications, is refined by Ant UED Team.', | ||
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.' | ||
}; | ||
}); | ||
} |
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