Search code examples
htmlvue.jsw3c-validation

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?


Solution

  • 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.