xyxiao001 / vue-cropper

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

使用组件报错:组件没有模板或渲染函数 #807

Open zml212 opened 2 months ago

zml212 commented 2 months ago

image 代码如下: 组件内引入

import 'vue-cropper/dist/index.css'
import VueCropper from "vue-cropper"

使用

<VueCropper ref="mycropper" mode="cover" :img="options.img" :info="true" :autoCrop="options.autoCrop"
                :autoCropWidth="options.autoCropWidth" :autoCropHeight="options.autoCropHeight"
                :fixedBox="options.fixedBox" :outputType="options.outputType" @realTime="realTime"
                v-if="cropperDialogVisible"></VueCropper>

用的的Vue3+ts+vite

xyxiao001 commented 2 months ago

https://github.com/xyxiao001/cropper-test 可以参考这个仓库看看

zml212 commented 2 months ago

如果是这样引入的话:

import 'vue-cropper/dist/index.css'
import {VueCropper}  from "vue-cropper"

会报一堆错: image