Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'swipe' does not exist, v-touch is any #24

Open
petarhristov94 opened this issue Apr 22, 2023 · 2 comments
Open

Property 'swipe' does not exist, v-touch is any #24

petarhristov94 opened this issue Apr 22, 2023 · 2 comments

Comments

@petarhristov94
Copy link

For the following code inside my <template>:

<div ref="container" class="content" v-touch:swipe="handleContentSwipe">
  ...
</div>

I get the warning

Property 'swipe' does not exist on type '{ $: ComponentInternalInstance; $data: { timelineRef: Ref<HTMLDivElement> | null; wrapperRef: Ref<HTMLDivElement> | null; ... 6 more ...; timelineEvents: { ...; }[]; }; ... 11 more ...; $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => a...'.ts(2339)

additionally the v-touch directive is of type any:
image

Here's how I've imported the package to my vue 3 typescript project, using yarn and vite. I also use Volar in VS Code.
In main.ts:

/* Vue Touch Events */
import Vue3TouchEvents, {
  type Vue3TouchEventsOptions,
} from "vue3-touch-events";

...

app.use(Vue3TouchEvents, {
  disableClick: true,
} as Vue3TouchEventsOptions);
app.mount("#app");

Any ideas how to fix the typings?

@kirbby
Copy link

kirbby commented Apr 22, 2023

Additional info, it happens on all events (press, swipe,...)
While using vue-tsc 1.2.0 it will compile (altough in VS Code it shows the error), when going to the latest vue-tsc 1.4.4 it doesn't compile and fails with the error described by @petarhristov94 .

@kirbby
Copy link

kirbby commented Apr 23, 2023

It got fixed in vue-tsc. This can be closed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants