mirror of
https://github.com/directus/directus.git
synced 2026-01-23 14:47:56 -05:00
@@ -81,17 +81,29 @@ export default defineComponent({
|
||||
return items.map((item) => {
|
||||
const choice = (props.choices || []).find((choice) => choice.value === item);
|
||||
|
||||
let itemStringValue: string;
|
||||
|
||||
if (typeof item === 'object') {
|
||||
itemStringValue = JSON.stringify(item);
|
||||
} else {
|
||||
if (props.format) {
|
||||
itemStringValue = formatTitle(item);
|
||||
} else {
|
||||
itemStringValue = item;
|
||||
}
|
||||
}
|
||||
|
||||
if (choice === undefined) {
|
||||
return {
|
||||
value: item,
|
||||
text: props.format ? formatTitle(item) : item,
|
||||
text: itemStringValue,
|
||||
foreground: props.defaultForeground,
|
||||
background: props.defaultBackground,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
value: item,
|
||||
text: choice.text || (props.format ? formatTitle(item) : item),
|
||||
text: choice.text || itemStringValue,
|
||||
foreground: choice.foreground || props.defaultForeground,
|
||||
background: choice.background || props.defaultBackground,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user