Skip to content

Commit

Permalink
update alpine docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Jan 21, 2024
1 parent a40a3f8 commit 7a0a197
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/integrations/alpinejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ You can also use the `_import` function in the `x-data` object. This requires yo
</button>
```

You can also import a module right inside a Alpine listener. This involves making the listener expression async. For example:

```html
<x-import module="sweetalert" as="swal" />

<button
x-on:click="async () => {
let swal = await _import('swal')
swal('Hello world!');
}"
>
Trigger Sweetalert dialog
</button>
```

## Roadmap

There are a couple of cool ideas in the pipe. One of them is [backed Alpine components](https://laravel-bundle.dev/roadmap.html#backed-alpine-components). It would be incredible if this feature is possible in the future 🤞

0 comments on commit 7a0a197

Please sign in to comment.