eslint rules
This commit is contained in:
parent
5541e46d50
commit
7398d20132
|
@ -168,12 +168,12 @@ export default class Autocomplete extends Input {
|
|||
}
|
||||
|
||||
onSelectionRequest(data) {
|
||||
if (data && data.length > 0)
|
||||
if (data && data.length > 0)
|
||||
if (this.multiple)
|
||||
this.selection = data;
|
||||
else
|
||||
this.selection = data[0];
|
||||
else
|
||||
else
|
||||
this.selection = null;
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ export default class Autocomplete extends Input {
|
|||
let display = '';
|
||||
let hasTemplate = this.$transclude && this.$transclude.isSlotFilled('tplItem');
|
||||
|
||||
if (this._selection && this.showField)
|
||||
if (this._selection && this.showField)
|
||||
if (this.multiple && Array.isArray(this._selection)) {
|
||||
for (let item of this._selection) {
|
||||
if (display.length > 0) display += ', ';
|
||||
|
@ -194,13 +194,12 @@ export default class Autocomplete extends Input {
|
|||
display = this.$interpolate(template)(this._selection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.input.value = display;
|
||||
|
||||
if (this.translateFields)
|
||||
if (this.translateFields)
|
||||
if (this.translateFields.indexOf(this.showField) > -1)
|
||||
this.input.value = this.$translate.instant(display);
|
||||
|
||||
|
||||
this.mdlUpdate();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue