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

Intellisense Works For Data Props in Computed, And Also It Doesn't Work #2394

Closed
3 tasks done
XiNiHa opened this issue Oct 22, 2020 · 4 comments
Closed
3 tasks done

Comments

@XiNiHa
Copy link

XiNiHa commented Oct 22, 2020

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: macOS

  • Vetur version: v0.28.0

  • VS Code version: 1.50.1

  • Nuxt 2.14.6

  • TypeScript 4.0.3

Problem

스크린샷 2020-10-22 오전 11 11 42

The first section shows that the type of the data property is being inferred correctly. However, in the second section, an error occurs. While I've faced that type error for a while, I was bypassing the check by using $data. However, I just realized that the type inference was working correctly in the other side.

I've found some similar issues about type inference in computed properties, but not the exact same one - so I decided to submit a new one.

@XiNiHa
Copy link
Author

XiNiHa commented Oct 22, 2020

스크린샷 2020-10-22 오전 11 28 31

Okay this looks much weirder... both events and viewDate are defined in data() and only one of them is not getting type inference.

@XiNiHa
Copy link
Author

XiNiHa commented Oct 22, 2020

Seems to be not related to Vetur

@XiNiHa XiNiHa closed this as completed Oct 22, 2020
@yoyo930021
Copy link
Member

Duplicate of #2131

@yoyo930021 yoyo930021 marked this as a duplicate of #2131 Oct 22, 2020
@yoyo930021
Copy link
Member

yoyo930021 commented Oct 22, 2020

Issues: #1707, #1509, vuejs/vue#8721, vuejs/vue#9873

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants