Load Alpine as a script tag and start it later #1710
Replies: 3 comments 2 replies
-
That new vue lib looks super interesting. They are not mounting by default unless you have init attribute on script tag.
(https://github.com/vuejs/petite-vue/blob/main/src/index.ts) I could see maybe doing the opposite in Alpine if enough people had the requirement, it would be pretty trivial to add inverse logic. Not sure what the attribute would be called tho? Interesting tho |
Beta Was this translation helpful? Give feedback.
-
The same issue is described here: #1705 |
Beta Was this translation helpful? Give feedback.
-
Maybe there's some |
Beta Was this translation helpful? Give feedback.
-
Using Alpine as a module, it is possible to load the library and start it later on using
Alpine.start()
. It would be super useful to be able to do the same when Alpine is loaded as a script. That would allow to load the Alpine script before declaringAlpine.data
components and remove the need to wrap them in analpine:init
event listener.For reference, this is possible with petite-vue! 😉 https://github.com/vuejs/petite-vue#manual-init
Beta Was this translation helpful? Give feedback.
All reactions