we-plugin / we-cropper

微信小程序图片裁剪工具
https://we-plugin.github.io/we-cropper/#/
MIT License
2.18k stars 451 forks source link

[Bug Report] 使用mpvue版本加上示例demo出现错误 #166

Open lijibing01 opened 4 years ago

lijibing01 commented 4 years ago

we-cropper 版本

"mpvue-cropper": "^0.2.3"

对应工具或者iOS或者Andriod的版本号

7.0.10

微信版本号

7.0.10

重现步骤

1、在uni-app中npm安装mpvue-cropper 2、使用Usage example示例组件 3、使用时能正确显示界面,但是选中相片后就会报错。

期待的行为

选中相片后能正常使用

实际的行为

选中相片后能出现js错误 thirdScriptError Cannot read property 'pushOrign' of undefined;at api chooseImage success callback function TypeError: Cannot read property 'pushOrign' of undefined at VueComponent.pushOrigin (http://127.0.0.1:42198/appservice/node-modules/_mpvue-cropper@0.2.3@mpvue-cropper/mpvue-cropper.js:194:27) at success (http://127.0.0.1:42198/appservice/pages/tone/avatar.js:252:25) at Function.o.(anonymous function) (http://127.0.0.1:42198/appservice/__dev__/WAService.js:1:1182257) at Object.success (http://127.0.0.1:42198/appservice/__dev__/WAService.js:1:108166) at r (http://127.0.0.1:42198/appservice/__dev__/WAService.js:1:436734) at http://127.0.0.1:42198/appservice/__dev__/WAService.js:1:436911 at v (http://127.0.0.1:42198/appservice/__dev__/WAService.js:1:436920) at http://127.0.0.1:42198/appservice/__dev__/WAService.js:1:438362 at t. (http://127.0.0.1:42198/appservice/__dev__/asdebug.js:1:12078) at http://127.0.0.1:42198/appservice/__dev__/WAService.js:1:108166

JakeWoki commented 4 years ago

mpvue-cropper.vue里的onLoad改成created试试,触摸的$event.mp可能也要改成$event.mpEvent