Hi!
I use your package as a plugin in my app. Then I need to setup global options for all input after.
But I can't find anything guide me.
Please guide me to make it!
Thanks
What options do you want to set?
If you want to do something after all change event.
You need to change the code inner.
import DatePicker from 'vue2-datepicker'
DatePicker.methods.updateDate = function() {
DatePicker.methods.updateDate();
// do your things
}
Hi! Thank for your reply.
I want to set global language and format date time. In the document, I only can find the setting as props.
I need do it at all my component. I think it a bad way!
Longtime wait for a reply....
import DatePicker from 'vue2-datepicker'
DatePicker.props.format="MM-YYYY"
This works for me:
DatePicker.props.lang.default = process.env.VUE_APP_I18N_LOCALE;//es
DatePicker.props.format.default = Constants.General.DATE_FORMAT;//DD-MM-YYYY
Vue.component('date-picker', DatePicker);
This works for me. I changed a handful of default values globally as I want all of my date inputs to be the same 99% of the time:
DatePicker.props.format.default = "MM/DD/YYYY";
DatePicker.props.editable.default = false;
DatePicker.props.inputClass.default = "form-control";
DatePicker.props.placeholder.default = "Select date";
DatePicker.props.appendToBody.default = false;
DatePicker.props.popupStyle.default = function _default() { return {left: 0}; };