Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera

uno-de-piera/form.vue Secret

Created Jan 22, 2018
Embed
What would you like to do?
<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
You can’t perform that action at this time.