-
-
Save uno-de-piera/78e67d8fc59ee8cfcd80512944529c21 to your computer and use it in GitHub Desktop.
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
<template> | |
<form id="registerForm" method="POST" @submit.prevent="validateBeforeSubmit"> | |
<fieldset> | |
<legend>Mi formulario con Vuejs 2</legend> | |
<div class="form-group col-xs-3 col-md-2"> | |
<label for="firstname" class="control-label">Nombre</label> | |
<input | |
v-model="firstname" | |
name="firstname" | |
class="form-control" | |
id="firstname" | |
placeholder="Nombre" | |
v-validate="'required'" | |
:class="{'has-errors': errors.has('firstname')}" | |
> | |
<FormError :attribute_name="'firstname'" :errors_form="errors"> </FormError> | |
</div> | |
<!-- componente anidado --> | |
<my-date-component></my-date-component> | |
</fieldset> | |
</form> | |
</template> | |
<script> | |
import FormError from '../FormError'; | |
import MyDateComponent from '../MyDateComponent'; | |
export default { | |
name: "form-component", | |
components: { FormError, MyDateComponent } | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment