Answer the question
In order to leave comments, you need to log in
How to pass a value from a directive to a component?
component part:
<input :name="'bankingsInput['+index+'][invoice_date]'" type="text" v-model="row.invoice_date" class="form-control" v-datetimepicker="row.invoice_date">
Vue.directive('datetimepicker', {
bind: function (el, binding, vnode) {
console.log(this)
console.log(vnode)
$(el).datetimepicker(datetimepickerDefaults)
$(el).data('DateTimePicker').date(moment(binding.value, 'DD.MM.YYYY'))
$(el).on('dp.change', function (event) {
vnode.context.$emit('input', event.date || null);
});
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question