xyxiao001 / vue-cropper

A simple picture clipping plugin for vue
https://github.xyxiao.cn/vue-cropper/docs/vue3.html
MIT License
4.3k stars 695 forks source link

为啥报Home.vue?bff2:42 Uncaught ReferenceError: vueCropper is not defined?? #63

Closed 91martincheung closed 6 years ago

91martincheung commented 6 years ago

image 安装npm install vue-cropper 使用 import VueCropper from vue-cropper

都是按步骤来的,删了重装还是这样

xyxiao001 commented 6 years ago

没引入成功吧 你在mounted里面打印vueCropper看看

xyxiao001 commented 6 years ago

v8d9b um_ zl22zjv8c vtl 上下大小写一致

91martincheung commented 6 years ago

嗯嗯,这个是咋回事呢? image

xyxiao001 commented 6 years ago

这个是你ref没声明吧 通过组件实例去调用方法

91martincheung commented 6 years ago

image ref="cropper"后报这错请问是咋回事?

xyxiao001 commented 6 years ago

打印看看this.$refs.cropper是不是组件的

91martincheung commented 6 years ago

不行打印不出来。。。。

xyxiao001 commented 6 years ago

那说明你this指向出了问题 或者ref名字不是这个

91martincheung commented 6 years ago

😭请问如何更改呢

xyxiao001 commented 6 years ago

ak1smlhx 3_gl_l2t42b4 r 不知道你怎么写的 可能是函数里面this指向变了

91martincheung commented 6 years ago

2018-01-1111😖

xyxiao001 commented 6 years ago

image 上面是cropper2 下面是cropper

91martincheung commented 6 years ago

image 改了还是报同样的错。。。。

xyxiao001 commented 6 years ago

? 这些button不需要啊 组件实例上写ref="cropper" 因为你下面调用写的是cropper

91martincheung commented 6 years ago

image preview(base64)没反应是啥情况?

xyxiao001 commented 6 years ago

你看看回调函数执行没有 打印下的

91martincheung commented 6 years ago

image

xyxiao001 commented 6 years ago

我的意思是在回调函数里面打印 看看执行回调函数没有

91martincheung commented 6 years ago

image 执行了else里的

xyxiao001 commented 6 years ago

这就是回调回来的base64的

91martincheung commented 6 years ago

再问个问题,怎么看到截取后的图片?

xyxiao001 commented 6 years ago

把数据放在img src上面就行

91martincheung commented 6 years ago

感谢!!么么哒

91martincheung commented 6 years ago

我想问问就是手机上测试,当裁剪框跟页面的宽度一样的时候,框里的图片是不是不能移动和放大缩小?

xyxiao001 commented 6 years ago

有属性 固定截图框就可以

91martincheung commented 6 years ago

嗯嗯,还有个问题就是可让upload的图片载入时宽等于裁剪框的宽吗?

xyxiao001 commented 6 years ago

现在还没有这个方法

91martincheung commented 6 years ago

希望大神哥哥能加这新功能~🙇