vuejs/vetur

Interpolation doesn't work with spaces in attribute/value pair

Open

#3133 aperta il 31 ago 2021

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)TypeScript (594 fork)github user discovery
buggood first issuelsp:completiontemplate-interpolation

Metriche repository

Star
 (5752 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

  • I have searched through existing issues (I searched for Interpolation, didn't find any matches, but if it's still a duplicate, I'm sorry, please close this)
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Windows, macOS
  • Vetur version: 0.34.1
  • VS Code version: 1.59.1

Problem

Vetur's interpolation is great, but doesn't work when the attribute, = and value has a space between them. For example, interpolation works when you write code like this:

<component v-if="1 < 2"/>

However, it doesn't work when you write code like this

<component v-if = "1 < 2"/>

GitHub is able to handle the interpolation correctly as you can see above.

In VS Code, the condition is highlighted as a string. It's a minor inconvenience at best, and probably there might be some limitations which might not allow this and in that case, feel free to close the issue. But if it can be implemented, it would be great!

Guida contributor