fix(editor): Fix rundata type errors (no-changelog) (#9443)

This commit is contained in:
Csaba Tuncsik
2024-05-21 13:19:56 +02:00
committed by GitHub
parent 277511a9b5
commit cd751e7cc8
13 changed files with 95 additions and 55 deletions

View File

@@ -22,6 +22,9 @@ type Props = {
const props = defineProps<Props>();
const isSchemaValueArray = computed(() => Array.isArray(props.schema.value));
const schemaArray = computed(
() => (isSchemaValueArray.value ? props.schema.value : []) as Schema[],
);
const isSchemaParentTypeArray = computed(() => props.parent?.type === 'array');
const isFlat = computed(
() =>
@@ -71,9 +74,10 @@ const getIconBySchemaType = (type: Schema['type']): string => {
return 'sun';
case 'undefined':
return 'ban';
default:
checkExhaustive(type);
return '';
}
checkExhaustive(type);
};
</script>
@@ -117,7 +121,7 @@ const getIconBySchemaType = (type: Schema['type']): string => {
</label>
<div v-if="isSchemaValueArray" :class="{ [$style.sub]: true, [$style.flat]: isFlat }">
<run-data-schema-item
v-for="(s, i) in schema.value"
v-for="(s, i) in schemaArray"
:key="`${s.type}-${level}-${i}`"
:schema="s"
:level="level + 1"