3 ms·
That is ridiculous amount of javascript within an html attribute. Do all major editors/IDE have proper Alpine plugins in order to highlight autocomplete js code
by mhitza 3y ago
That is ridiculous amount of javascript within an html attribute. Do all major editors/IDE have proper Alpine plugins in order to highlight autocomplete js code within those html attributes?
- badbotty 3y agoNo idea
- iambateman 3y agoIt's possible to extract the data-attribute out to it's own thing: document.addEventListener('alpine:init', () => { Alpine.data('video', () => ({ 'show_video': false, ... That way there's code highlighting and syntax checking for JS. I definitely go this route for Alpine about half the time.
- selcuka 3y ago> Do all major editors/IDE have proper Alpine plugins PyCharm doesn't seem to have one (I hope I'm wrong). That being said, it is possible to put the code into a proper <script> block. I personally only a trivial amount of code in html attributes such as checking a boolean value with `x-show`.