Fixed #858 - Autocomplete crashes when "field" property is a function

pull/880/head
Cagatay Civici 2021-01-20 12:23:37 +03:00
parent 59d04e8344
commit 1e18b3f26c
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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;
}