File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ order : 11
3+ title :
4+ zh-CN : 只设置图标
5+ en-US : With Icon only
6+ ---
7+
8+ ## zh-CN
9+
10+ 在 Segmented Item 选项中只设置 Icon。
11+
12+ ## en-US
13+
14+ Set ` icon ` without ` label ` for Segmented Item.
Original file line number Diff line number Diff line change 1+ import { Component } from '@angular/core' ;
2+
3+ import { NzSegmentedOptions } from 'ng-zorro-antd/segmented' ;
4+
5+ @Component ( {
6+ selector : 'nz-demo-segmented-with-icon-only' ,
7+ template : `<nz-segmented [nzOptions]="options"></nz-segmented>`
8+ } )
9+ export class NzDemoSegmentedWithIconOnlyComponent {
10+ options : NzSegmentedOptions = [
11+ { value : 'List' , icon : 'bars' } ,
12+ { value : 'Kanban' , icon : 'appstore' }
13+ ] ;
14+ }
Original file line number Diff line number Diff line change 33 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
44 */
55
6- export interface NzSegmentedOption {
7- label : string ;
6+ export type NzSegmentedOption = {
87 value : string | number ;
98 useTemplate ?: boolean ;
10- icon ?: string ;
119 disabled ?: boolean ;
1210 className ?: string ;
11+ } & ( NzSegmentedWithLabel | NzSegmentedWithIcon ) ;
12+
13+ export interface NzSegmentedWithLabel {
14+ label : string ;
15+ icon ?: string ;
16+ }
17+
18+ export interface NzSegmentedWithIcon {
19+ icon : string ;
20+ label ?: string ;
1321}
1422
1523export type NzSegmentedOptions = Array < NzSegmentedOption | string | number > ;
You can’t perform that action at this time.
0 commit comments