Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera uno-de-piera/DateComponent.vue Secret
Created Jan 22, 2018

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