<template>
<FormElleMain
v-model="frm"
#default="{ isValid }"
>
<FormElleInput
type="text"
v-model="frm.name"
required
/>
<button @click.prevent="create()" :disabled="!isValid">
Save
</button>
</FormElleMain>
</template>
<script>
import { ref } from 'vue';
import {
FormElleInput,
FormElleMain
} from '../components/forms';
export default {
name: "MyComponent",
components: {
FormElleInput,
FormElleMain
},
async setup() {
const frm = ref({
name: "",
})
return {
frm,
}
}
}
</script>
<FormElleInput
type="text"
v-model="frm.name"
required
/>
<FormElleInput
type="text"
v-model="frm.name"
:validation-custom="{
foundElle: (value) => ['elle'].includes(value)
}"
:validation-message="{
foundElle: 'Oh no! message contains Elle??'
}"
/>