4 ms·
It's possible to extract the data-attribute out to it's own thing: document.addEventListener('alpine:init', () => { Alpine.data('video', () => ({
by iambateman 3y ago
It'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.