Skip to content

Commit

Permalink
fix: validator
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanvier committed Sep 25, 2024
1 parent b416ffe commit c3bad26
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@wgr-sa/nuxt-form",
"description": "Form builder for Nuxt",
"version": "0.8.8",
"version": "0.8.9",
"repository": "https://github.com/WGR-SA/nuxt-form.git",
"author": "jeanvier",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion playground/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
name="asdf"
:rules="[ 'isEmail']"
/>
<FormInput label='yo <a href="#">ok</a>' type="checkbox" name="tosnlpd" :rules="[{ equals: [true], message: 'coucou' }]" />
<!-- <FormInput label='yo <a href="#">ok</a>' type="checkbox" name="tosnlpd" :rules="[{ equals: [true], message: 'coucou' }]" /> -->
<FormInput name="safs" :rules="['isNotEmpty']" />
<FormTextarea name="saffs" :rules="['isNotEmpty']" />
<FormRadio :options="{'O': 'Oui', 'N': 'Non'}" name="yo" laebl="Yo" />
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/composables/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useFormValidator = () => {
return
}

if (form.data.state[field]) {
if (field in form.data.state) {
// @ts-ignore TODO: import only validation functions
const result = validator(form.data.state[field].toString(), rule.$params.options)

Expand Down

0 comments on commit c3bad26

Please sign in to comment.