Improvements and fixes to logs page

This commit is contained in:
Nassim Jahnke 2023-02-14 16:07:53 +01:00
parent 03f7e3000c
commit e3bc6ac556

View File

@ -41,12 +41,24 @@ const props = withDefaults(
} }
); );
function getValue(val: Record<string, string>) { function getValue(val: any) {
return typeof props.itemValue === "function" ? props.itemValue(val) : val[props.itemValue]; if (typeof props.itemValue === "function") {
return props.itemValue(val);
} else if (val[props.itemValue]) {
return val[props.itemValue];
} else {
return val as string;
}
} }
function getText(val: Record<string, string>) { function getText(val: any) {
return typeof props.itemText === "function" ? props.itemText(val) : val[props.itemText]; if (typeof props.itemText === "function") {
return props.itemText(val);
} else if (val[props.itemText]) {
return val[props.itemText];
} else {
return val as string;
}
} }
watch(internalVal, (val) => emit("search", val)); watch(internalVal, (val) => emit("search", val));