xyxiao001 / vue-cropper

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

大佬们,nuxt3怎么使用,求解答 #794

Open radin-mu opened 6 months ago

radin-mu commented 6 months ago

nuxt3我全局导入了插件,nuxtApp.vueApp._context.components里面有VueCropper,但是我在页面上使用,ref获取不到这个,元素里面也渲染不出来

ValueLan commented 6 months ago

nuxt 目的是ssr ssr 目的是seo 他这个组件seo没有意义


<ClientOnly>
 这里写你的业务组件
</ClientOnly>
icguanyu commented 5 months ago

just use in components (nuxt3 )

<script setup>
 import { VueCropper }  from "vue-cropper";
 import 'vue-cropper/dist/index.css'
</script>

<template>
  <div class="my-cropper">
   <VueCropper  ref="cropper" :img="option.img" .../>
  </div>
</template>