mikeric / rivets

Lightweight and powerful data binding.
http://rivetsjs.com
MIT License
3.23k stars 309 forks source link

Is there any way to use WC3 valid attributes for rivets? #718

Closed Andrinoid closed 7 years ago

Andrinoid commented 7 years ago

First of all, thank you guys for the wonderful framework. Here is my issue. I'm get WC3 error for every rv- attribute I have on my page. Is there anyway to use valid attributes with rivets.

Namek commented 7 years ago

Maybe change the prefix from rv to data-rv? Search "prefix" in "Configuring" section on http://rivetsjs.com/docs/guide/

Andrinoid commented 7 years ago

Thank you. I had to use only data as prefix. I might be wrong but I think the hyphen is used as a logic separator in some binders so data-rv failed in some cases. Below is the configuration that worked for me.

rivets.configure({
  // Attribute prefix in templates
  prefix: 'data',
})

then in my templates <div data-if="app.someValue">