Closed julianvk closed 5 years ago
Fixed, was to do with my setup with Vue.use()
@julianvk Im glad you fixed it. Thanks for using vue-croppie
@jofftiquez Can I register the VueCroppie
component locally instead of in my main.js file?
When I try to do the following:
<template>
<!-- just an example -->
<vue-croppie ref="croppieRef"></vue-croppie>
</template>
<script>
import VueCroppie from 'vue-croppie'
import 'croppie/croppie.css'
export default {
name: 'MyComponent',
components: { VueCroppie },
}
</script>
I always get this error:
[Vue warn]: Unknown custom element: <vue-croppie> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
Putting VueCroppie
in main.js and doing Vue.use(VueCroppie)
works as expected but I'd rather lazy load this library only on the page where I need it.
Currently recieving this issue:
[Vue warn]: Failed to mount component: template or render function not defined. found in ---> <VueCroppie>
Did recieve this issue first
[Vue warn]: Unknown custom element: <vue-croppie> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
so imported VueCroppie directly on the component instead of in main.js which raised the current issue.My Component.vue is a direct copy/past of the sample code. Have tried installing and using on two seperate projects.
Any help would be greatly appreciated