Open pixelmusik opened 9 months ago
I am getting compiler errors when using the cropper along with Vue 3 setup syntax and TypeScript.
<template> <vue-cropper ref="cropper" src="demo.jpg" /> </template> <script setup lang="ts"> import { ref, onMounted } from "vue"; import VueCropper from "vue-cropperjs"; const cropper = ref<InstanceType<typeof VueCropper>>(); onMounted(() => { // This throws a compiler error (Property "reset" does not exist on type...) cropper.value?.reset(); }); </script>
For each method called this way I am getting a compiler error.
TS2339: Property 'reset' does not exist on type 'CombinedVueInstance<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => V ue<Record<string, any>, Record<string, any>, never, never, ...>>, ... 7 more ..., OptionTypesType<...>>'.
I have the following node packages installed.
I am getting compiler errors when using the cropper along with Vue 3 setup syntax and TypeScript.
AppComponent.vue
For each method called this way I am getting a compiler error.
I have the following node packages installed.