Skip to content

Commit

Permalink
fix enum property (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulBredl authored Oct 19, 2023
1 parent 617119c commit 69f7cba
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const valueProperty = computed({
return valueToSelectionOption(props.propertyData);
},
set(newValue: {name: string; value: any} | undefined) {
if (typeof newValue !== 'object') {
emit('update:propertyData', newValue);
return;
}
emit('update:propertyData', newValue?.value);
},
});
Expand All @@ -34,6 +38,9 @@ function valueToSelectionOption(value: any): any {
if (value === undefined) {
return undefined;
}
if (!props.possibleValues.includes(value)) {
return value;
}
let formattedValue = `${value}`;
if (value === null) {
formattedValue = 'null';
Expand Down

0 comments on commit 69f7cba

Please sign in to comment.