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

Usage not detected when imported interfaces is referred in templates only #1280

Closed
olemarius opened this issue May 9, 2022 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@olemarius
Copy link

Volar v0.34.11
VSCode 1.67.0

TS error:

<script lang="ts" setup>
  import type { Profile } from '@/services/api/models'; // 'Profile' is declared but never used. ts(6196)
  ....
</script>
<template>
  <div v-for="profile in profiles as Profile[]">
</template>

Works:

<script lang="ts" setup>
  import type { Profile } from '@/services/api/models'; // 'Profile' is declared but never used. ts(6196)
  const profiles = ref<Profile[] | undefined>();
</script>
<template>
  <div v-for="profile in profiles as Profile[]">
  ...
  </div>
</template>
@johnsoncodehk
Copy link
Member

Duplicate of #891

@johnsoncodehk johnsoncodehk marked this as a duplicate of #891 Jul 16, 2022
@johnsoncodehk johnsoncodehk added the duplicate This issue or pull request already exists label Jul 16, 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

No branches or pull requests

2 participants