1
0
mirror of synced 2024-11-22 21:36:04 +03:00
vue-formulario/storybook/stories/FormularioInput.tale.vue

45 lines
954 B
Vue

<template>
<FormularioForm v-model="values">
<FormularioInput
v-slot="{ context }"
name="text"
validation="number|required"
>
<label for="text-field">Text field</label>
<div>
<input
id="text-field"
v-model="context.model"
type="text"
>
</div>
<div
v-for="(error, index) in context.allErrors"
:key="index"
>
{{ error.message }}
</div>
</FormularioInput>
</FormularioForm>
</template>
<script>
import FormularioForm from '@/FormularioForm'
import FormularioInput from '@/FormularioInput'
export default {
name: 'FormularioInputTale',
components: {
FormularioForm,
FormularioInput,
},
data: () => ({
values: {},
})
}
</script>