Noction / vue-draggable-grid

https://noction.github.io/vue-draggable-grid/
88 stars 33 forks source link

Typescript issues #38

Closed mortenscheel closed 8 months ago

mortenscheel commented 8 months ago

Hi, thanks for fixing the issue with type imports so fast. Here are a couple of additional typescript related issues that I don't know how to fix myself.

When building my project, vue-tsc throws an error regarding app.use(VueDraggableGrid):

error TS2345: Argument of type 'typeof import("/path/to/project/node_modules/@noction/vue-draggable-grid/dist/types/index")' is not assignable to parameter of type 'Plugin<[]>'.

I've tried importing the GridLayout component directly, in stead of using the plugin, but that doesn't seem to be possible.

import { GridLayout } from '@noction/vue-draggable-grid';

This works fine when running vite in dev mode, but vue-tsc throws an error when I try to build it:

error TS2305: Module '"@noction/vue-draggable-grid"' has no exported member 'GridLayout'`

I don't know if it helps, but I discovered something weird when I tried importing it like this:

import { GridLayout } from '@noction/vue-draggable-grid/dist/components';

It still won't build, but it sort of fixed #18 in that my IDE could suddenly complete the component props. It still wasn't aware of slot names though.

xmatthias commented 8 months ago

On a similar note - with 1.9.12, i'm now getting the following error (during typescript-checking - with vue-tsc --noEmit).

src/plugins/vue-grid-layout.ts:1:30 - error TS2307: Cannot find module '@noction/vue-draggable-grid' or its corresponding type declarations.

1 import VueDraggableGrid from '@noction/vue-draggable-grid';
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

however, that import is exactly what the readme is explaining as the working method..

The last version that did work for me is 1.9.10 ... which is the version i've currently hard-pinned.

LwveMike commented 8 months ago

Sorry for the inconvenience, this should be fixed in v1.9.14

xmatthias commented 8 months ago

Can confirm, works now with 1.9.14 :+1:

leifcr commented 5 months ago

It seems that this issue is back in version 1.11.0