You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need an exported TypeScript interface named something like Vue3Autocounter that we can import and use for the TypeScript template ref definition.
Currently there is no exported interface for us to use. Or at least none that I could find.
For example:
<template><vue3autocounterref='counter' :startAmount='0' :endAmount='2021' :duration='3' '/>
<button @click='handleClick'>Startcounting</button></template><scriptsetuplang="ts">// Import everythingimportVue3autocounterfrom"vue3-autocounter";// Define the template refconstcounter=ref<Vue3Autocounter|null>(null);// Call the start methodconsthandleClick=()=>{counter.start();}</script>
Here I am using Vue3Autocounter in const counter = ref<Vue3Autocounter | null>(null) as an example. But actually that example will not work because Vue3Autocounter was just made up for illustration purposes and was never imported because it doesn't currently exist.
The text was updated successfully, but these errors were encountered:
You are right, in the last released version is not possible to have an exported type for the component. I`m working on the next release with no breaking changes and I'll add this as an enhancement in this new version. You can open a PR with the implementation if you need it now, in the meantime.
We need an exported TypeScript interface named something like
Vue3Autocounter
that we can import and use for the TypeScript template ref definition.Currently there is no exported interface for us to use. Or at least none that I could find.
For example:
Here I am using
Vue3Autocounter
inconst counter = ref<Vue3Autocounter | null>(null)
as an example. But actually that example will not work becauseVue3Autocounter
was just made up for illustration purposes and was never imported because it doesn't currently exist.The text was updated successfully, but these errors were encountered: