pletox / alpine-blade-setup
Enable <script setup> with props(), mount(), and auto-imports for Alpine.js in Blade components and pages.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/pletox/alpine-blade-setup
Requires
- php: >=8.1
- illuminate/support: ^9.0 || ^10.0 || ^11.0 || ^12.0
README
Use Vue-style <script setup>
in Laravel Blade components and pages with support for:
props([...])
→@props([...])
mount(...) => ({})
→x-data="{...}"
- Computed
get x() {}
→x() { ... }
- Auto-imports from
@/utils/xyz.js
Installation
composer require pletox/alpine-blade-setup
Usage
In your Blade file:
<script setup> import { formatTime } from '@/utils/time' props(['from']) mount(props => ({ seconds: 0, get time() { return formatTime(this.seconds) } })) </script> <div x-text="time"></div>
License
MIT