Alternative attribute prefixes not using dashes (x_data instead of x-data) #3587
RobinManoli
started this conversation in
3. Feature Ideas
Replies: 1 comment
-
This issue has been converted to a discussion as we are now using discussions to track bugs and ideas. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Wondering if there is a way to avoid the dashes for the alpine attributes, so for example to use x_data instead of x-data.
The motivation is if your backend for example uses python (py4web, web2py) there are html helpers so that you can write html in python. You can create a div as such, and write the attribute "class" as "_class":
DIV("hello world", _class="myclass") # would reproduce <div class="myclass">hello world</div>
If you want to add the x-data attribute you can't use this syntax:
DIV("hello world", _x-data="not valid I will fail")
So it would be good with an alternative:
DIV("hello world", _x_data="I would work") # would reproduce <div x_data="I would work">hello world</div>
More info on the specific python here https://pypi.org/project/yatl/ and https://py4web.com/_documentation/static/en/chapter-10.html
Beta Was this translation helpful? Give feedback.
All reactions