Conflicts in v-scroll directive with VueUse #17468
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Because of that issue, I have to downgrade Quasar at least to 2.12.0 version. |
Beta Was this translation helpful? Give feedback.
-
IMO Vue language tools should handle this differently. Since you are importing the directive specifically, it should use the types for that. It should only fall back to the global types when there is no specific import. You can report this to https://github.com/vuejs/language-tools if you wish. Here is a simple workaround which is much better than pinning <script lang="ts" setup>
import { type UseScrollReturn } from '@vueuse/core';
import { vScroll as vUseScroll } from '@vueuse/components';
// ...
</script>
<template>
<div
v-use-scroll="[
(state: UseScrollReturn) => {
// some logic
},
{ throttle: 100 },
]"
/>
</template> Btw, for this specific case, you could Quasar's Scroll directive like this: <script lang="ts" setup>
import { debounce, ScrollValue } from 'quasar'
const onScroll: NonNullable<ScrollValue> = (top, left) => {
// some logic
};
</script>
<template>
<div v-scroll="debounce(onScroll, 100)" />
</template> |
Beta Was this translation helpful? Give feedback.
IMO Vue language tools should handle this differently. Since you are importing the directive specifically, it should use the types for that. It should only fall back to the global types when there is no specific import.
You can report this to https://github.com/vuejs/language-tools if you wish. Here is a simple workaround which is much better than pinning
quasar
to2.12.2
: