Docs: Fix cascader dynamically load example (#15352)

pull/15178/head
Moonhyuk Im 2019-05-07 13:02:38 +09:00 committed by iamkun
parent 340da2ff61
commit 74105a6de3
4 changed files with 16 additions and 16 deletions

View File

@ -1136,12 +1136,12 @@ Load child options when their parent option is clicked or hovered over.
handleItemChange(val) {
console.log('active item:', val);
setTimeout(_ => {
if (val.indexOf('California') > -1 && !this.options2[0].cities.length) {
this.options2[0].cities = [{
if (val.indexOf('California') > -1 && !this.options[0].cities.length) {
this.options[0].cities = [{
label: 'Los Angeles'
}];
} else if (val.indexOf('Florida') > -1 && !this.options2[1].cities.length) {
this.options2[1].cities = [{
} else if (val.indexOf('Florida') > -1 && !this.options[1].cities.length) {
this.options[1].cities = [{
label: 'Orlando'
}];
}

View File

@ -1141,12 +1141,12 @@ Se puede hacer una carga dinamica de elementos hijos cuando se hace clic en el e
handleItemChange(val) {
console.log('active item:', val);
setTimeout(_ => {
if (val.indexOf('California') > -1 && !this.options2[0].cities.length) {
this.options2[0].cities = [{
if (val.indexOf('California') > -1 && !this.options[0].cities.length) {
this.options[0].cities = [{
label: 'Los Angeles'
}];
} else if (val.indexOf('Florida') > -1 && !this.options2[1].cities.length) {
this.options2[1].cities = [{
} else if (val.indexOf('Florida') > -1 && !this.options[1].cities.length) {
this.options[1].cities = [{
label: 'Orlando'
}];
}

View File

@ -1136,12 +1136,12 @@ Il est possible de charger dynamiquement les options quand on clique ou passe la
handleItemChange(val) {
console.log('active item:', val);
setTimeout(_ => {
if (val.indexOf('California') > -1 && !this.options2[0].cities.length) {
this.options2[0].cities = [{
if (val.indexOf('California') > -1 && !this.options[0].cities.length) {
this.options[0].cities = [{
label: 'Los Angeles'
}];
} else if (val.indexOf('Florida') > -1 && !this.options2[1].cities.length) {
this.options2[1].cities = [{
} else if (val.indexOf('Florida') > -1 && !this.options[1].cities.length) {
this.options[1].cities = [{
label: 'Orlando'
}];
}

View File

@ -1136,12 +1136,12 @@
handleItemChange(val) {
console.log('active item:', val);
setTimeout(_ => {
if (val.indexOf('江苏') > -1 && !this.options2[0].cities.length) {
this.options2[0].cities = [{
if (val.indexOf('江苏') > -1 && !this.options[0].cities.length) {
this.options[0].cities = [{
label: '南京'
}];
} else if (val.indexOf('浙江') > -1 && !this.options2[1].cities.length) {
this.options2[1].cities = [{
} else if (val.indexOf('浙江') > -1 && !this.options[1].cities.length) {
this.options[1].cities = [{
label: '杭州'
}];
}