johnsoncodehk / vue-tsc

vue-tsc --noEmit && vite build
https://www.npmjs.com/package/vue-tsc
MIT License
241 stars 6 forks source link

Latest version of vue-tsc throws error on template slots variables #81

Closed Hugo01 closed 3 years ago

Hugo01 commented 3 years ago

Hi, I'm having trouble figuring out why vue-tsc is throwing errors on build when this type of situation happens: For instance, I'm using a lib called primevue, on his documentation it shows

<DataTable :value="customers1"
                    dataKey="id" v-model:filters="filters" filterDisplay="row" :loading="loading">
    <Column field="name" header="Name">
        <template #filter="{filterModel,filterCallback}">
            <InputText type="text" v-model="filterModel.value" @keydown.enter="filterCallback()" class="p-column-filter" :placeholder="`Search by name - ${filterModel.matchMode}`"/>
        </template>
    </Column>
<DataTable>

vue-tsc throws error TS2339: Property 'filterModel' does not exist on type 'VNode<RendererNode, RendererElement, { [key: string]: any; }>[]'.

Which didn't happen on previous versions of vue-tsc

johnsoncodehk commented 3 years ago

I think it's $slots type problem but not sure where is it from, please provide a repro case.

johnsoncodehk commented 3 years ago

See https://github.com/primefaces/primevue/issues/1635#issuecomment-934207363