question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warn if colon shorthand is used on v-if/v-html/etc.

See original GitHub issue

What problem does this feature solve?

I just spent way too long debugging something really weird until I realized I accidentally wrote :v-if instead of v-if.

A warning when wrongly using shorthands like : on “native” vue attributes could prevent this bad experience easily.

What does the proposed API look like?

:v-if="foo"

–> console.warn("You specified v-bind:/ v-on: or a corresponding shorthand on a Vue attribute like v-if or similar. Usually this does not make sense.)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:21
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
posvacommented, Jun 25, 2019

I’ve seen this happen so often when teaching Vue that even though having a prop named vIf is technically valid, I think this warning would help much more people than ever hurt

4reactions
oielbannacommented, Dec 18, 2020

I was going to give it a go but it seems there’s a super old PR for this already

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I solve "Interpolation inside attributes has been ...
Vue template syntax error: id="purchase-{{ item.id }}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead.
Read more >
Shorthand - Wikipedia
Shorthand is an abbreviated symbolic writing method that increases speed and brevity of writing as compared to longhand, a more common method of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found