Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upWarn if colon shorthand is used on v-if/v-html/etc. #10191
Comments
This comment has been minimized.
This comment has been minimized.
I've seen this happen so often when teaching Vue that even though having a prop named |
This comment has been minimized.
This comment has been minimized.
Yes. If you wanted a prop, why should have the same name as a
|
This comment has been minimized.
This comment has been minimized.
I'll take this on. It'll be my first issue here. |
This comment has been minimized.
This comment has been minimized.
Thanks but as the tag suggest there is already a Pull request for this |
This comment has been minimized.
This comment has been minimized.
习惯就好 |
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 ofv-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.)