vuedx / languagetools

A collection of tools for better IDE experience.

Home Page:https://vuedx.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VueDX Dynamic slots not recognized properly

TheDutchCoder opened this issue · comments

Describe the bug
Consider the following code:

Running for /Users/reinierkaper/projects/creativelayer/chalk-ui
src/components/data/table/table.vue:29:21 - error VueDX/TS2339: Property '$slots' does not exist on type '{ $: ComponentInternalInstance; $data: {}; $props: Partial<{ error: boolean; rowAction: Function; loading: boolean; borderless: boolean; defaultFilter: string; defaultOrder: string; }> & Pick<...>; ... 13 more ...; order: string; }'.
 26 |               >{{ header }}</span>
 27 |               <span
 28 |                 data-table-sortArrow
    |                    ~~~~~~
 29 |                 class="w-4 text-center"
 30 |               >

Edit: this error is actually bubbling up from a dynamic slot, VueDX wrongly highlights this line but it wasn't related. See my below screenshot for the real issue

To Reproduce

  1. Create dynamically named slots
  2. Run vuedx-typecheck and it will fail on those slots.

Expected behavior
Not to throw errors.

Info (please complete the following information):

  • OS Mac 11.2.1
  • IDE VSCode
  • TypeScript Version 4.1.3
  • Vue Version latest

I think the real issue is actually elsewhere:
image

Those slots are named dynamically, not sure how to get around this?