johnsoncodehk / vue-tsc

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

vue-tsc --noEmit show error when using slot in vue template #79

Closed ndh103 closed 3 years ago

ndh103 commented 3 years ago

Vue Language Features (Volar) version v0.27.27 TypeScript Vue Plugin (Volar) version v0.27.27

vue-tsc show error when I use slot

<v-date-picker v-model="event.eventDate">
        <template #default="{ togglePopover }">
          <div class="flex flex-wrap">
            <button
              class="app-btn-datepicker"
              @click.stop="dateSelected($event, togglePopover)"
            >
              {{ event.eventDate.toLocaleDateString() }}
            </button>
          </div>
        </template>
      </v-date-picker>

with this error in the '#default'


Property 'default' does not exist on type '({} | {}) & ({} | Record<string, any>)'.
  Property 'default' does not exist on type '{}'.ts(2339)

tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "useDefineForClassFields": true,
    "module": "esnext",
    "moduleResolution": "node",
    "strict": true,
    "jsx": "preserve",
    "sourceMap": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "lib": ["esnext", "dom"],
    "strictNullChecks": false,
    "noImplicitAny": false,
    "allowSyntheticDefaultImports": true,
    "skipLibCheck": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}
ndh103 commented 3 years ago

Dupplicated with https://github.com/johnsoncodehk/volar/issues/547