xyxiao001 / vue-cropper

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

vue3.0+ts 使用vue-cropper 1.0.2 版本报错 #598

Closed okaxuan closed 2 years ago

okaxuan commented 3 years ago

全局引入: import VueCropper from 'vue-cropper'; import 'vue-cropper/dist/index.css' app.use(VueCropper)

option1 在setup()已定义

runtime-core.esm-bundler.js?5c40:38

   [Vue warn]: Unhandled error during execution of render function 

at <VueCropper ref="cropper" img="https://avatars2.githubusercontent.com/u/15681693?s=460&v=4" outputSize=1 ... > at <Index onVnodeUnmounted=fn

vue-cropper.es.js?04b0:1 Uncaught (in promise) TypeError: Object(...) is not a function at Proxy.g.render (vue-cropper.es.js?04b0:1)

xyxiao001 commented 3 years ago

https://github.com/xyxiao001/cropper-test/blob/master/src/App.vue 看看例子

xyxiao001 commented 3 years ago

vue3 不是 use 了吧,是 vue.component

xyxiao001 commented 3 years ago

https://codepen.io/xyxiao001/pen/yLooYKg

okaxuan commented 3 years ago

@xyxiao001 Thanks!