I have the following component defined as below:
import Vue from 'vue';
import Datepicker from 'vuejs-datepicker';
Vue.component('DatePicker', {
template: `
<datepicker name="date"></datepicker>
`,
});
Which I am trying to import it from another file and use it in another component but for some reason I am getting error like:
[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.
I am pretty new to Vue.js so I am wondering if someone can guide me what am I doing wrong here!
Here is how I am trying to use the component:
require('./datetime-picker');
<DatePicker></DatePicker>
Vue.component('DatePicker' ....before initialize Vue instancenew Vue({ ...?