Attempt to fix displayName undefined error (#3424)

This commit is contained in:
Prospector
2025-03-25 18:04:50 -07:00
committed by GitHub
parent fd2f500038
commit 4508fad588
3 changed files with 22 additions and 10 deletions

View File

@@ -51,10 +51,10 @@
<Avatar :src="option.icon" :circle="circledIcons" />
<div class="text">
<div class="title">
{{ displayName(option.title) }}
{{ getOptionLabel(option.title) }}
</div>
<div class="author">
{{ displayName(option.subtitle) }}
{{ getOptionLabel(option.subtitle) }}
</div>
</div>
</div>
@@ -98,7 +98,7 @@ const props = defineProps({
},
displayName: {
type: Function,
default: (option) => option,
default: undefined,
},
circledIcons: {
type: Boolean,
@@ -106,6 +106,10 @@ const props = defineProps({
},
})
function getOptionLabel(option) {
return props.displayName?.(option) ?? option
}
const emit = defineEmits(['input', 'onSelected', 'update:modelValue', 'enter'])
const dropdownVisible = ref(false)