Open mcekiera opened 6 years ago
IMHO, I think the docs are clear enough. The v-*
lookup has a good behavior. It makes debugging easier, if you want to add a property v-something
and not want Vue to treat it as a directive, you should be using data attributes
So instead of <div v-fake/>
it should be <div data-v-fake/>
Maybe it would make more sense to resolve the directive and show an error (like when there is no value)
@posva I guess that could work.
Version
2.5.17
Reproduction link
http://jsfiddle.net/wf48v9de/3/
Steps to reproduce
Run the fiddle and look at console.
What is expected?
If there is not registered directive named 'v-fake', Vue should ignore this attribute of an element.
What is actually happening?
Vue treat every 'v-[something]' attribute as directive, regardless if it is registered globally or locally, or not at all. It is trying to compute the value of 'v-' beginning attribute, and in effect throws TypeError, as it doesn't find property named like string passed to attribute.
if it is intentional, there should be information about such behavior in Vue docs. However in my opinion it should ignore such attributes.