Warn if colon shorthand is used on v-if/v-html/etc.
See original GitHub issueWhat 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:
- Created 4 years ago
- Reactions:21
- Comments:9 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 hurtI was going to give it a go but it seems there’s a super old PR for this already