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

Strange error with possible undefined property #1308

Closed
3 tasks done
orblazer opened this issue May 23, 2019 · 1 comment · Fixed by #1309
Closed
3 tasks done

Strange error with possible undefined property #1308

orblazer opened this issue May 23, 2019 · 1 comment · Fixed by #1309

Comments

@orblazer
Copy link

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

Info

  • Platform: Linux
  • Vetur version: 0.21.0
  • VS Code version: 1.33.1

Problem

I have strange error on new Date with potential undefined property
Screenshot_20190523_173704

The user.createdAt is defined in an interface with :

createdAt?: Date

Reproducible Case

  1. Create an property with potential property undefined like :
    test: { testVal?: Date } = {
      testVal: new Date()
    }
  2. Try display that property with {{ new Date(test.testVal || 0) }}
@ktsn ktsn self-assigned this May 23, 2019
@ktsn
Copy link
Member

ktsn commented May 23, 2019

This is because NewExpression is currently not handled by template interpolation service. I'll add support for it.

octref added a commit that referenced this issue Jun 19, 2019
yoyo930021 pushed a commit to yoyo930021/vuter that referenced this issue Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants