disable create directory button if no input
This commit is contained in:
@@ -15,6 +15,9 @@ const dialog = useCreateDirectoryDialog();
|
|||||||
|
|
||||||
const creating = ref(false);
|
const creating = ref(false);
|
||||||
const directoryName = ref('');
|
const directoryName = ref('');
|
||||||
|
const directoryNameValid = computed(
|
||||||
|
() => directoryName.value.trim().length > 0
|
||||||
|
);
|
||||||
|
|
||||||
async function submit() {
|
async function submit() {
|
||||||
creating.value = true;
|
creating.value = true;
|
||||||
@@ -59,7 +62,11 @@ async function submit() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<Button :disabled="creating" @click="submit">Create</Button>
|
<Button
|
||||||
|
:disabled="!directoryNameValid || creating"
|
||||||
|
@click="submit"
|
||||||
|
>Create</Button
|
||||||
|
>
|
||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|||||||
Reference in New Issue
Block a user