vue.draggable.next icon indicating copy to clipboard operation
vue.draggable.next copied to clipboard

TypeScript is any

Open hairyf opened this issue 4 years ago • 4 comments

image

image

hairyf avatar Mar 15 '21 06:03 hairyf

image image

songjianet avatar Apr 02 '21 08:04 songjianet

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

marcotollini avatar Apr 20 '21 15:04 marcotollini

I have the same problem. It's a pity that typescript is not fully supported.

jkcs avatar Jun 30 '21 08:06 jkcs

image image

I have the same problem. can you resolve this ?

tonyamano24 avatar Nov 07 '22 16:11 tonyamano24