Skip to content

Commit cd419a2

Browse files
committed
Merge branch 'next' of github.com:devforth/adminforth into next
2 parents dea0e12 + 1060cad commit cd419a2

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

adminforth/documentation/docs/tutorial/03-Customization/15-afcl.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,23 @@ Default behavior of the Dialog component will allow user to close it by just cli
519519
</div>
520520
</div>
521521

522+
### Dialog open and close
523+
524+
You can open and close dialog by calling `open` and `close` methods.
525+
526+
```ts
527+
528+
const confirmDialog = ref(null);
529+
530+
const openDialog = () => {
531+
confirmDialog.value.open();
532+
}
533+
534+
const closeDialog = () => {
535+
confirmDialog.value.close();
536+
}
537+
```
538+
522539
## Dropzone
523540

524541
```ts

adminforth/spa/src/afcl/Dialog.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,17 @@ onUnmounted(() => {
9898
modal.value?.destroy();
9999
})
100100
101+
function open() {
102+
modal.value?.show();
103+
}
104+
105+
function close() {
106+
modal.value?.hide();
107+
}
108+
109+
defineExpose({
110+
open: open,
111+
close: close,
112+
})
113+
101114
</script>

adminforth/spa/src/components/ColumnValueInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
{ label: t('Yes'), value: true },
176176
{ label: t('No'), value: false },
177177
];
178-
if (!column.required[props.mode]) {
178+
if (!column.required[props.mode] && !column.isArray?.enabled) {
179179
options.push({ label: t('Unset'), value: null });
180180
}
181181
return options;

adminforth/spa/src/components/ResourceForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ const columnOptions = computedAsync(async () => {
276276
},
277277
});
278278
279-
if (!column.required[props.source]) list.items.push({ value: null, label: column.foreignResource.unsetLabel });
279+
if (!column.required[props.source] && !column.isArray?.enabled) list.items.push({ value: null, label: column.foreignResource.unsetLabel });
280280
281281
return { [column.name]: list.items };
282282
}

0 commit comments

Comments
 (0)