I am trying to use vue-croppa
for image cropping and I installed it using npm
as follows:
npm install --save vue-croppa
But when I use it as I normally would:
import Croppa from 'vue-croppa'
export default {
components: {
Croppa
}
}
I get error:
[Vue warn]: Failed to mount component: template or render function not defined.
Instead I have to do this:
import Croppa from 'vue-croppa'
export default {
components: {
Croppa.component
}
}
What could be wrong?
https://github.com/zhanziyang/vue-croppa#1-import-vue-croppa-into-your-vuejs-project
Look at the manual. It is not a component, but a plugin. You have to Vue.use
it
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.