mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-10 18:38:22 +00:00
Nice Form Validation Schema Support
This commit is contained in:
parent
66c60d8135
commit
edb7c09de3
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
const props = defineModel<{
|
||||
title: string
|
||||
validationSchema: Record<string, string | Function>,
|
||||
sections: {
|
||||
title: string
|
||||
fields: {
|
||||
|
@ -19,12 +20,12 @@ const props = defineModel<{
|
|||
discard: () => void,
|
||||
}>();
|
||||
|
||||
let { sections, submit, discard } = $(props);
|
||||
let { sections, submit, discard, validationSchema } = $(props);
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ValidationForm as="div" v-slot="{ values, handleSubmit }" @submit="submit">
|
||||
<ValidationForm as="div" v-slot="{ values, handleSubmit }" @submit="submit" :validationSchema="validationSchema">
|
||||
<template v-for="(section, index) in sections" :key="index">
|
||||
<h4 v-if="section.title">{{ section.title }}</h4>
|
||||
<div class="section">
|
||||
|
|
Loading…
Add table
Reference in a new issue