[英]vue-croppa as component abnormal behavior, Failed to mount component: template or render function not defined
I am trying to use vue-croppa
for image cropping and I installed it using npm
as follows: 我正在尝试使用
vue-croppa
进行图像裁剪,并使用npm
如下安装了它:
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.
[Vue警告]:无法安装组件:未定义模板或渲染功能。
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 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 您必须使用
Vue.use
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.