avancement planning
This commit is contained in:
Generated
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
|
||||
.change-options {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
Generated
Vendored
+1
-2
@@ -4,6 +4,5 @@
|
||||
[(ngModel)]="values"
|
||||
[nzShowSearch]="true"
|
||||
(ngModelChange)="onChanges($event)"
|
||||
></nz-cascader>
|
||||
<a (click)="changeNzOptions()" class="change-options">Change Options</a>
|
||||
/>
|
||||
|
||||
Generated
Vendored
+5
-64
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { NzCascaderModule, NzCascaderOption } from 'ng-zorro-antd/cascader';
|
||||
@@ -46,43 +46,6 @@ const options: NzCascaderOption[] = [
|
||||
}
|
||||
];
|
||||
|
||||
const otherOptions = [
|
||||
{
|
||||
value: 'fujian',
|
||||
label: 'Fujian',
|
||||
children: [
|
||||
{
|
||||
value: 'xiamen',
|
||||
label: 'Xiamen',
|
||||
children: [
|
||||
{
|
||||
value: 'Kulangsu',
|
||||
label: 'Kulangsu',
|
||||
isLeaf: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
value: 'guangxi',
|
||||
label: 'Guangxi',
|
||||
children: [
|
||||
{
|
||||
value: 'guilin',
|
||||
label: 'Guilin',
|
||||
children: [
|
||||
{
|
||||
value: 'Lijiang',
|
||||
label: 'Li Jiang River',
|
||||
isLeaf: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@Component({
|
||||
selector: '<%= selector %>',
|
||||
imports: [FormsModule, NzCascaderModule],
|
||||
@@ -92,35 +55,13 @@ const otherOptions = [
|
||||
[(ngModel)]="values"
|
||||
[nzShowSearch]="true"
|
||||
(ngModelChange)="onChanges($event)"
|
||||
></nz-cascader>
|
||||
<a (click)="changeNzOptions()" class="change-options">Change Options</a>
|
||||
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>,
|
||||
<% if(inlineStyle) { %>styles: [`
|
||||
.change-options {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
`]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
|
||||
/>
|
||||
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
|
||||
})
|
||||
export class <%= classify(name) %>Component implements OnInit {
|
||||
nzOptions: NzCascaderOption[] | null = null;
|
||||
export class <%= classify(name) %>Component {
|
||||
readonly nzOptions: NzCascaderOption[] = options;
|
||||
values: string[] | null = null;
|
||||
|
||||
ngOnInit(): void {
|
||||
setTimeout(() => {
|
||||
this.nzOptions = options;
|
||||
}, 100);
|
||||
}
|
||||
|
||||
changeNzOptions(): void {
|
||||
if (this.nzOptions === options) {
|
||||
this.nzOptions = otherOptions;
|
||||
} else {
|
||||
this.nzOptions = options;
|
||||
}
|
||||
}
|
||||
|
||||
onChanges(values: string[]): void {
|
||||
console.log(values, this.values);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user