We'll do this in 0.2.x once alpinejs/alpine#1166 is merged
init() is aware of the component data & element (unlike the constructor), so it can add HTML attributes similarly to x-spread. Combined with automatic invocation of init(), it will be possible to use this package like this:
<div x-data="Alpine.component('foo')()">
And the foo component will be capable of adding attributes to the root element, setting state in init(), and everything else — automatically.
We'll do this in 0.2.x once alpinejs/alpine#1166 is merged
init()is aware of the component data & element (unlike the constructor), so it can add HTML attributes similarly tox-spread. Combined with automatic invocation ofinit(), it will be possible to use this package like this:And the
foocomponent will be capable of adding attributes to the root element, setting state ininit(), and everything else — automatically.