alpine-turbo-drive-adapter
Version:
Bridge library to enable full support for Alpine components in pages using Turbolinks/Turbo Drive
19 lines (16 loc) • 589 B
HTML
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/@hotwired/turbo/dist/turbo.es2017-umd.min.js"></script>
<script src="/dist/alpine-turbo-drive-adapter.js" defer></script>
<script src="//unpkg.com/alpinejs" defer></script>
<meta name="turbo-refresh-method" content="morph">
</head>
<body>
<div x-data="{shown: false}">
<turbo-frame x-show="shown" id="frame" refresh="morph" src="/frame" loading="lazy">
<p>Initial Content</p>
</turbo-frame>
<button @click="shown = true">Start Loading Frame</button>
</div>
</body>
</html>