fix no options in repeater (#9113)

before: page does render if repeater has no options
after: page renders and repeater showe no options
This commit is contained in:
José Varela
2021-10-25 16:44:49 +01:00
committed by GitHub
parent 7eb2cb1137
commit bf2b7e8d01

View File

@@ -131,7 +131,9 @@ export default defineComponent({
const drawerOpen = computed(() => active.value !== null);
const { value } = toRefs(props);
const templateWithDefaults = computed(() => props.template || `{{${props.fields[0].field}}}`);
const templateWithDefaults = computed(() =>
props.template || props.fields?.[0]?.field ? `{{${props.fields[0].field}}}` : ''
);
const showAddNew = computed(() => {
if (props.disabled) return false;