-
-
Save uno-de-piera/eef52f02065e9e38502eb33dc8fb71c9 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> | |
<fieldset class="app-border"> | |
<div class="form-group col-xs-2 col-md-2"> | |
<label for="initDate" class="control-label">Date Field</label> | |
<datePicker | |
v-model="initDate" | |
language="en" | |
id="initDate" | |
format="dd/MM/yyyy" | |
name="initDate" | |
v-validate="'required'" | |
:class="{'has-errors': errors.has('initDate')}" | |
> | |
</datePicker> | |
<FormError :attribute_name="'initDate'" :errors_form="errors"> </FormError> | |
</div> | |
</fieldset> | |
</template> | |
<script> | |
import DatePicker from 'vuejs-datepicker'; | |
import FormError from '../FormError'; | |
export default { | |
name: "my-date-component", | |
inject: ['$validator'], //esta es la clave | |
components: { | |
DatePicker, FormError | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment