- {{ displayName(option.title) }}
+ {{ getOptionLabel(option.title) }}
- {{ displayName(option.subtitle) }}
+ {{ getOptionLabel(option.subtitle) }}
@@ -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)