apexcharts / vue3-apexcharts

📊 Vue-3 component for ApexCharts
MIT License
314 stars 35 forks source link

Event type check error #112

Closed tsaiian closed 4 months ago

tsaiian commented 4 months ago
<script setup lang="ts">

...<skip>...

function zoomed(chartContext, { xaxis, yaxis }) {
    // do something...
}

</script>
<template>
    <apexchart ref="chart" type="bar" :options="chartOptions" :series="series" @zoomed="zoomed">
    </apexchart>
</template>

The above code generates the following error when executing vue-tsc --noEmit:

error TS2322: Type '(chartContext: any, { xaxis, yaxis }: { xaxis: any; yaxis: any; }) => void' is not assignable to type 'never'.

It looks like the type definition for the zoomed event is wrong

tsaiian commented 4 months ago

this error come from wrong defineProps syntax.

not vue3-apexcharts issue, sorry.