-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
925 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,53 @@ | ||
<template> | ||
<VForm :form="form"> | ||
<FormGroup> | ||
<input type="text" name="test" /> | ||
</FormGroup> | ||
<VForm :form="form" class="flex flex-col gap-4" @submit="onSubmit" @v-submit="onVSubmit"> | ||
<VLabel class="flex flex-col"> | ||
Label {{ form.fields.test.value }} | ||
<input type="text" name="test" required /> | ||
</VLabel> | ||
|
||
<VLabel fieldName="select" class="flex flex-col"> | ||
Select | ||
<select name="select2"> | ||
<option value="hallo">hallo</option> | ||
<option value="zwallo">zwallo</option> | ||
<option value="drallo">drallo</option> | ||
</select> | ||
</VLabel> | ||
|
||
<button>submit</button> | ||
</VForm> | ||
|
||
<pre | ||
<VLabel :field="form.fields.test2" class="flex flex-col mt-4"> | ||
Label | ||
<input type="text" name="test2" disabled required /> | ||
</VLabel> | ||
|
||
<button @click="form.disabled ? form.enable() : form.disable()"> | ||
{{ form.disabled ? 'enable' : 'disable' }} | ||
</button> | ||
|
||
<pre class="mt-6" | ||
>{{ form.values }} | ||
</pre> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { VForm, useForm, FormGroup } from '@vuetils/form'; | ||
import { required } from '@vuetils/form'; | ||
import { VForm, useForm, VLabel } from '@vuetils/form'; | ||
const form = useForm({ | ||
test: [''], | ||
test: ['', [required]], | ||
test2: [''], | ||
select: ['drallo'], | ||
}); | ||
function onSubmit() { | ||
console.log('on submit'); | ||
} | ||
function onVSubmit() { | ||
console.log('on v submit'); | ||
} | ||
</script> | ||
|
||
<style></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Test | ||
|
||
::test | ||
Hi | ||
:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.