vue.draggable.next
vue.draggable.next copied to clipboard
TypeScript is any



The definition of the types is wrong, and so typescript defines the component as any.
In turn, I was unable to call methods and computed properties, receiving the error "Property 'foo' does not exist on type...."
Following is the terrible bugfix I did, following what element plus is doing with their components:
import {DefineComponent} from 'vue';
import draggable from 'vuedraggable';
/* TERRIBLE FIX WAITING FOR BETTER FIX */
/* From el-main type */
const Draggable = draggable as DefineComponent<
// eslint-disable-next-line @typescript-eslint/ban-types
{},
// eslint-disable-next-line @typescript-eslint/ban-types
{},
// eslint-disable-next-line @typescript-eslint/ban-types
{},
// eslint-disable-next-line @typescript-eslint/ban-types
{},
// eslint-disable-next-line @typescript-eslint/ban-types
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
import('vue').EmitsOptions,
string,
import('vue').VNodeProps &
import('vue').AllowedComponentProps &
import('vue').ComponentCustomProps,
// eslint-disable-next-line @typescript-eslint/ban-types
Readonly<{} & {}>,
// eslint-disable-next-line @typescript-eslint/ban-types
{}
>;
It does the trick, but it is terrible at the very least
I have the same problem. It's a pity that typescript is not fully supported.
I have the same problem. can you resolve this ?