Open zeuyanik opened 6 years ago
@zeuyanik I also had the same problem. You will not be able to register the plugin globally since it is not exporting a vue package. I had to import locally into each component in order to work.
@zeuyanik @lucca-cardial Try to register it manually like this
import Vue from 'vue';
import DateRangePicker from 'vue-rangedate-picker';
Vue.component('vuejs-daterangepicker', DateRangePicker);
new Vue({
...
});
You can change 'vuejs-daterangepicker'
with whatever name you want.
Notice that Vue.component
method should be called before new Vue
.
@bondansebastian thanks. works great. Seems like something that should be documented? @bliblidotcom?
@bondansebastian -- The critical information for me was the simple but cogent advice:
Notice that
Vue.component
method should be called before newVue
.
That was the reason for my getting the error message. Thanks.
This worked in my case.
Create a
config
folder right wheremain.js
is.In that folder create
setup-component.js
file.
import WHAT from '../where/notsurewhere';
function setupComponents(Vue) {
Vue.component('what', WHAT);
}
export { setupComponents };
// Note: Same as file
And at last, just import that in
main.js
import { setupComponents } from './config/setup-components';
A friend of mine suggested this.
Hi everyone, I followed the instruction on the https://bliblidotcom.github.io/vue-rangedate-picker/
but. code gives me the following error;
My vue code is the following;
What am I missing?