SunnyQjm / taro-cropper

Taro框架下的跨端图片裁剪组件,目前支持微信小程序端,QQ小程序端, 支付宝小程序端, 字节跳动小程序端, 百度小程序端和H5端
https://sunnyqjm.github.io/taro-cropper/#/
111 stars 45 forks source link

Trao3中编译报错,望修复,谢谢 #20

Closed lxzy-yun closed 4 years ago

lxzy-yun commented 4 years ago

image

shenghanqin commented 4 years ago

@lxzy-yun 其实我的项目中有这个插件的3.0版本的封装,当然是在小程序内跑通了,在h5版本有问题,因为taro 3.0的h5版本有 web Component的bug

mataoct commented 4 years ago

同问

SunnyQjm commented 4 years ago

@lxzy-yun

关于Taro不同版本安装

Taro3版本的组件代码参考 v3.x-react分支

lxzy-yun commented 4 years ago

@lxzy-yun

关于Taro不同版本安装

  • taro v1.x 和 taro v2.x 如果使用Taro1和2进行开发,库的使用和之前一样,直接安装即可,基本支持微信小程序端, QQ小程序端, 支付宝小程序端, 字节跳动小程序端, 百度小程序端和H5端。
    npm install --save taro-cropper
  • taro v3.x React 如果使用Taro3进行开发,且使用的React进行开发,则可以选择安装下述包。目前在微信小程序端测试成功,H5端因为taro实现的一些问题,暂时还有问题。
    npm install --save taro-cropper@react

嗯嗯,不过里面有个打印输出可否去掉下呢,谢谢

SunnyQjm commented 4 years ago

@lxzy-yun

关于Taro不同版本安装

  • taro v1.x 和 taro v2.x 如果使用Taro1和2进行开发,库的使用和之前一样,直接安装即可,基本支持微信小程序端, QQ小程序端, 支付宝小程序端, 字节跳动小程序端, 百度小程序端和H5端。
    npm install --save taro-cropper
  • taro v3.x React 如果使用Taro3进行开发,且使用的React进行开发,则可以选择安装下述包。目前在微信小程序端测试成功,H5端因为taro实现的一些问题,暂时还有问题。
    npm install --save taro-cropper@react

嗯嗯,不过里面有个打印输出可否去掉下呢,谢谢

1.2.3版本没有多余日志输出了

lightShowers commented 4 years ago

VM129:1 The above error occurred in the component: in TaroCropperComponent (created by My) in view (created by My) in view (created by My) in view (created by My) in My (created by ConnectFunction) in ConnectFunction (created by Page) in root (created by Page) in Page (created by AppWrapper) in Provider (created by App) in App (created by AppWrapper) in AppWrapper

React will try to recreate this component tree from scratch using the error boundary you provided, Page.

lightShowers commented 4 years ago

VM129:1 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

Please update the following components: TaroCropperComponent console.warn @ VM129:1 printWarning @ vendors.js:4216 lowPriorityWarningWithoutStack @ vendors.js:4237 ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings @ vendors.js:4407 flushRenderPhaseStrictModeWarningsInDEV @ vendors.js:17747 commitRootImpl @ vendors.js:16995 unstable_runWithPriority @ vendors.js:25883 runWithPriority @ vendors.js:3964 commitRoot @ vendors.js:16989 finishSyncRender @ vendors.js:16393 performSyncWorkOnRoot @ vendors.js:16371 (anonymous) @ vendors.js:4014 unstable_runWithPriority @ vendors.js:25883 runWithPriority @ vendors.js:3964 flushSyncCallbackQueueImpl @ vendors.js:4009 flushSyncCallbackQueue @ vendors.js:3997 scheduleUpdateOnFiber @ vendors.js:15773 enqueueSetState @ vendors.js:5853 push../node_modules/react/cjs/react.development.js.Component.setState @ vendors.js:21690 (anonymous) @ index.tsx:60 Promise.then (async) (anonymous) @ index.tsx:56 onClick @ index.tsx:112 dispatchEvent @ runtime.esm.js:2321 eventHandler @ runtime.esm.js:699 r.safeCallback @ VM135 WAService.js:2 (anonymous) @ VM135 WAService.js:2 s @ VM135 WAService.js:2 (anonymous) @ VM135 WAService.js:2 r @ VM135 WAService.js:2 (anonymous) @ VM135 WAService.js:2 (anonymous) @ VM135 WAService.js:2 i @ VM16 asdebug.js:1 c @ VM16 asdebug.js:1 (anonymous) @ VM16 asdebug.js:1 p @ VM16 asdebug.js:1 g @ VM16 asdebug.js:1 (anonymous) @ VM16 asdebug.js:1 _ws.onmessage @ VM16 asdebug.js:1

shenghanqin commented 4 years ago

@SunnyQjm 3.0版是兼容了微信小程序和h5版本还是只做了小程序版本呢?

SunnyQjm commented 4 years ago

@shenghanqin 目前只兼容了微信小程序,h5我尝试适配了一下,发现taro转化后的代码没有把canvas的style传进去,所以canvas的大小有问题,准备有空再搞搞h5

shenghanqin commented 4 years ago

@shenghanqin 目前只兼容了微信小程序,h5我尝试适配了一下,发现taro转化后的代码没有把canvas的style传进去,所以canvas的大小有问题,准备有空再搞搞h5

很感谢。我就是因为这个图片裁剪插件一直没有适配成功h5端所以才暂时放弃Taro 3的。

Gnar-TNT commented 1 year ago

请问可以兼容一下taro+vue3吗。很需要这个组件 但是项目已经不允许转react了