ng-ytl-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
67 lines (58 loc) • 1.34 kB
text/typescript
import {Component} from '@angular/core';
const options = [{
value: 'zhejiang',
label: 'Zhejiang',
children: [{
value: 'hangzhou',
label: 'Hangzhou',
children: [{
value: 'xihu',
label: 'West Lake',
isLeaf: true
}],
}, {
value: 'ningbo',
label: 'Ningbo',
isLeaf: true
}],
}, {
value: 'jiangsu',
label: 'Jiangsu',
children: [{
value: 'nanjing',
label: 'Nanjing',
children: [{
value: 'zhonghuamen',
label: 'Zhong Hua Men',
isLeaf: true
}],
}],
}];
export class NzDemoCascaderCustomTriggerComponent {
/** init data */
_options = options;
_value: any[] = null;
_text = 'Unselect';
_console(value) {
console.log(value);
}
onSelectionChange(selectedOptions: any[]): void {
this._text = selectedOptions.map(o => o.label).join(', ');
}
}