Closed benhtn closed 3 years ago
Hello!
Yes, you're doing a thing wrong here: you need to actually tell Vue you're going to use the component. You can do it either globally:
import Datepicker from 'vue3-datepicker'
createApp(App)
.component('datepicker', Datepicker)
.mount('#app');
or locally:
<script>
import { ref } from 'vue'
import Datepicker from 'vue3-datepicker'
export default {
components: {
Datepicker
}
}
</script>
Either should fix this error, but I recommend the second option. To learn more, take a look at the docs.
Sorry in advance if this is just because I don't understand vue3 enough and how to use node modules. I am trying to create my first Vue 3 app - I have this in my package.json
this in main.js
and this kind of thing in my Test.vue
All I am getting is a runtime warning
[Vue warn]: Failed to resolve component: datepicker at <Test onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > at <RouterView> at <App>
and the component doesn't show up.Is it just that I am doing something wrong? Thank you