django-unicorn
django-unicorn copied to clipboard
Attribute unicorn:click is not allowed here in unicron template
hi guys i have no attribute unicorn:click in unicorn html
</ul>
<button unicorn:click="ali">hadi</button>
<!-- Tab panes -->
<div class="bg-products1 " >
Hello, I'm having a little trouble understanding what might be going on. Any chance you can make a public repo with a reproducible error, or fork this repo and add a failing test or example? Thanks!
I just ran into this and can maybe provide some more context
Technically unicorn:click
refers a attribute named click
from a namespace called unicorn
. So the root node should have a link to a XML schema for unicorn:*
attributes :
<div xmlns:unicorn="http://link-to-schema-listing-possible-unicorn-attributes">
IntelliJ (and presumably any strict HTML editor) will complain because there was no namespace defined for unicorn.
You can at least silence the issue by using a placeholder:
<div xmlns:unicorn="http://www.w3.org/1999/xhtml">
And that's enough for IntelliJ to let you add "unicorn:click" as a custom attribute.
The ideal solution would be an XML schema document that defines all of the attributes that unicorn supports.
I could contribute one if that's something that the maintainers would be interested in, but it also becomes something that has to be kept up to date as attributes are added/removed, and I'm not sure if that's something the project is interested in adding.