F
Filament16mo ago
gizmojo

Possible to combine JS loadedOnRequest with Alpine.data?

This gives undefined foo error - which's a function that's defined inside the foo.js file.
<div
x-load-js="[@js(\Filament\Support\Facades\FilamentAsset::getScriptSrc('foo'))]"
x-data="foo()"
>
<div
x-load-js="[@js(\Filament\Support\Facades\FilamentAsset::getScriptSrc('foo'))]"
x-data="foo()"
>
const foo = () => ({
// ...
});
window.Alpine.data("foo", foo);
const foo = () => ({
// ...
});
window.Alpine.data("foo", foo);
1 Reply
Want results from more Discord servers?
Add your server