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

[Bug] The type definition of props is missing in the template. #3592

Closed
zcf0508 opened this issue Sep 26, 2023 · 5 comments
Closed

[Bug] The type definition of props is missing in the template. #3592

zcf0508 opened this issue Sep 26, 2023 · 5 comments
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@zcf0508
Copy link
Contributor

zcf0508 commented Sep 26, 2023

volar version : 1.8.14

<script setup>
const props = defineProps({
  msg: String
})
</script>

<template>
  {{ msg }}  <!-- msg is undefined -->
  {{ props.msg }}  <!-- this is ok -->
</template>
@so1ve
Copy link
Member

so1ve commented Sep 26, 2023

Could you please provide a minimal reproduction?

image

@zcf0508
Copy link
Contributor Author

zcf0508 commented Sep 26, 2023

Sorry. I forgot to add more information.

I use vue 2.7.14 and setup script with js, but I set checkJs to true in jsconfig.json.

And I test setup script with ts, the type definitions are all right.

@zcf0508
Copy link
Contributor Author

zcf0508 commented Sep 26, 2023

If I downgrade the version of volar to 1.8.13, everything will be normal.

@so1ve
Copy link
Member

so1ve commented Sep 26, 2023

<script setup>
const props = defineProps({
  msg: String
})
</script>

<template>
  {{ msg }}  <!-- msg is undefined -->
  {{ props.msg }}  <!-- this is ok -->
</template>

You mean this?

@zcf0508
Copy link
Contributor Author

zcf0508 commented Sep 26, 2023

Yes! And I use vue2.

@so1ve so1ve added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first and removed need info labels Sep 26, 2023
johnsoncodehk added a commit that referenced this issue Oct 8, 2023
Co-authored-by: Johnson Chu <johnsoncodehk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

2 participants