mirror of https://github.com/ElemeFE/element
Docs: Fix cascader dynamically load example (#15352)
parent
340da2ff61
commit
74105a6de3
|
@ -1136,12 +1136,12 @@ Load child options when their parent option is clicked or hovered over.
|
||||||
handleItemChange(val) {
|
handleItemChange(val) {
|
||||||
console.log('active item:', val);
|
console.log('active item:', val);
|
||||||
setTimeout(_ => {
|
setTimeout(_ => {
|
||||||
if (val.indexOf('California') > -1 && !this.options2[0].cities.length) {
|
if (val.indexOf('California') > -1 && !this.options[0].cities.length) {
|
||||||
this.options2[0].cities = [{
|
this.options[0].cities = [{
|
||||||
label: 'Los Angeles'
|
label: 'Los Angeles'
|
||||||
}];
|
}];
|
||||||
} else if (val.indexOf('Florida') > -1 && !this.options2[1].cities.length) {
|
} else if (val.indexOf('Florida') > -1 && !this.options[1].cities.length) {
|
||||||
this.options2[1].cities = [{
|
this.options[1].cities = [{
|
||||||
label: 'Orlando'
|
label: 'Orlando'
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1141,12 +1141,12 @@ Se puede hacer una carga dinamica de elementos hijos cuando se hace clic en el e
|
||||||
handleItemChange(val) {
|
handleItemChange(val) {
|
||||||
console.log('active item:', val);
|
console.log('active item:', val);
|
||||||
setTimeout(_ => {
|
setTimeout(_ => {
|
||||||
if (val.indexOf('California') > -1 && !this.options2[0].cities.length) {
|
if (val.indexOf('California') > -1 && !this.options[0].cities.length) {
|
||||||
this.options2[0].cities = [{
|
this.options[0].cities = [{
|
||||||
label: 'Los Angeles'
|
label: 'Los Angeles'
|
||||||
}];
|
}];
|
||||||
} else if (val.indexOf('Florida') > -1 && !this.options2[1].cities.length) {
|
} else if (val.indexOf('Florida') > -1 && !this.options[1].cities.length) {
|
||||||
this.options2[1].cities = [{
|
this.options[1].cities = [{
|
||||||
label: 'Orlando'
|
label: 'Orlando'
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1136,12 +1136,12 @@ Il est possible de charger dynamiquement les options quand on clique ou passe la
|
||||||
handleItemChange(val) {
|
handleItemChange(val) {
|
||||||
console.log('active item:', val);
|
console.log('active item:', val);
|
||||||
setTimeout(_ => {
|
setTimeout(_ => {
|
||||||
if (val.indexOf('California') > -1 && !this.options2[0].cities.length) {
|
if (val.indexOf('California') > -1 && !this.options[0].cities.length) {
|
||||||
this.options2[0].cities = [{
|
this.options[0].cities = [{
|
||||||
label: 'Los Angeles'
|
label: 'Los Angeles'
|
||||||
}];
|
}];
|
||||||
} else if (val.indexOf('Florida') > -1 && !this.options2[1].cities.length) {
|
} else if (val.indexOf('Florida') > -1 && !this.options[1].cities.length) {
|
||||||
this.options2[1].cities = [{
|
this.options[1].cities = [{
|
||||||
label: 'Orlando'
|
label: 'Orlando'
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1136,12 +1136,12 @@
|
||||||
handleItemChange(val) {
|
handleItemChange(val) {
|
||||||
console.log('active item:', val);
|
console.log('active item:', val);
|
||||||
setTimeout(_ => {
|
setTimeout(_ => {
|
||||||
if (val.indexOf('江苏') > -1 && !this.options2[0].cities.length) {
|
if (val.indexOf('江苏') > -1 && !this.options[0].cities.length) {
|
||||||
this.options2[0].cities = [{
|
this.options[0].cities = [{
|
||||||
label: '南京'
|
label: '南京'
|
||||||
}];
|
}];
|
||||||
} else if (val.indexOf('浙江') > -1 && !this.options2[1].cities.length) {
|
} else if (val.indexOf('浙江') > -1 && !this.options[1].cities.length) {
|
||||||
this.options2[1].cities = [{
|
this.options[1].cities = [{
|
||||||
label: '杭州'
|
label: '杭州'
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue