vuejs/vetur

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

Open

#3,133 opened on Aug 31, 2021

View on GitHub
 (4 comments) (0 reactions) (0 assignees)TypeScript (594 forks)github user discovery
buggood first issuelsp:completiontemplate-interpolation

Repository metrics

Stars
 (5,752 stars)
PR merge metrics
 (PR metrics pending)

Description

  • 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!

Contributor guide