Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve the typing of default export, but named export can. #1524

Closed
miaulightouch opened this issue Jun 30, 2022 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@miaulightouch
Copy link

miaulightouch commented Jun 30, 2022

create vue3 project with typescript support, and add files below

<!-- TestUnit.vue -->
<script setup lang="ts">
import type { SomeClass2 } from "./SomeClass";
import type SomeClass from "./SomeClass";

const a = (i: any) => console.log(i);
</script>

<template>
  <div @hi="(x: SomeClass) => a(x)" @hello="(x: SomeClass2) => a(x)"></div>
</template>
// SomeClass.ts
export default class SomeClass {
  public someMethod(): void {
    console.log("Hello World");
  }
}

export class SomeClass2 {
  public someMethod(): void {
    console.log("Hello World");
  }
}

but only default export class cannot be resolved

image

@johnsoncodehk
Copy link
Member

Duplicate of #891

@johnsoncodehk johnsoncodehk marked this as a duplicate of #891 Jul 7, 2022
@johnsoncodehk johnsoncodehk added the duplicate This issue or pull request already exists label Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants