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

template compiler support Non-empty operator #4399

Closed
cool-delete opened this issue Aug 20, 2021 · 1 comment
Closed

template compiler support Non-empty operator #4399

cool-delete opened this issue Aug 20, 2021 · 1 comment

Comments

@cool-delete
Copy link

What problem does this feature solve?

I defined an optional array in the ts.d file, when I need to render an item, it will be judged based on the length of the array.

item v-if="car.trackPoints!.length" If don't add the middle exclamation operator, it will prompt ts(2532) err, but the code can run normally

After adding the! Operator, ts(2532) disappears, but it will prompt
[plugin:vite:vue] Error parsing JavaScript expression: Unexpected token, expected ","

What does the proposed API look like?

item v-if="car.trackPoints!.length"

@posva
Copy link
Member

posva commented Aug 20, 2021

Duplicate of #1359

@posva posva marked this as a duplicate of #1359 Aug 20, 2021
@posva posva closed this as completed Aug 20, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants