PierreB PierreB - 2 months ago 26
HTML Question

W3C Validation and Vue's HTML binding syntax

When I validate my page with the W3C validator, I get this error with Vue's event and binding syntax:


Error: Attribute
v-on:click
not allowed on element
div
at this point.


Is there a way to fix this?

Answer

They would ideally support the use of data-* attributes, e.g., data-v-on:click, but it seems they don’t.

See their issue Why not using HTML5 data-* attributes.

It seems that it was possible to overwrite the used prefix, but this option seems to have been removed.