arillo / silverstripe-cms-alpine
Makes alpinejs available in silverstripe CMS
Installs: 921
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
This package is auto-updated.
Last update: 2024-12-21 16:25:56 UTC
README
Loads alpinejs into CMS.
To instantiate you alpine components, you need to listen for the alpine:init
event like this:
/* global Alpine */
const component = {
init() {
console.log('yourComponent.init');
}
};
if (typeof Alpine !== 'undefined') {
Alpine.data('yourComponent', component);
}
document.addEventListener('alpine:init', () => {
Alpine.data('yourComponent', component);
});
Currently only alpinejs@3.12.3_dist_cdn.min.js
is available, support for other versions might come in future.