Fixed #858 - Autocomplete crashes when "field" property is a function
parent
59d04e8344
commit
1e18b3f26c
|
@ -3,7 +3,7 @@ import Vue, { VNode } from 'vue';
|
|||
declare class AutoComplete extends Vue {
|
||||
modelValue?: any;
|
||||
suggestions?: any[];
|
||||
field?: string;
|
||||
field?: string|function;
|
||||
scrollHeight?: string;
|
||||
dropdown?: boolean;
|
||||
dropdownMode?: string;
|
||||
|
|
|
@ -46,7 +46,7 @@ export default {
|
|||
default: null
|
||||
},
|
||||
field: {
|
||||
type: String,
|
||||
type: [String,Function],
|
||||
default: null
|
||||
},
|
||||
scrollHeight: {
|
||||
|
@ -457,7 +457,7 @@ export default {
|
|||
},
|
||||
inputValue() {
|
||||
if (this.modelValue) {
|
||||
if (this.field) {
|
||||
if (this.field && typeof this.modelValue === 'object') {
|
||||
const resolvedFieldData = ObjectUtils.resolveFieldData(this.modelValue, this.field);
|
||||
return resolvedFieldData != null ? resolvedFieldData : this.modelValue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue