Skip to content

Commit 935c7ff

Browse files
author
Funasitien DreamCloud
committed
⚡️ Toast (java)script
1 parent 6c466e5 commit 935c7ff

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/pages/index.astro

+13
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,17 @@ import Form from "../components/Form.astro";
293293
<div class="card" style="margin: 6rem;">
294294
<div class="card-body"><Form /></div>
295295
</div>
296+
297+
<script is:inline>
298+
const toastTrigger = document.getElementById("liveToastBtn");
299+
const toastLiveExample = document.getElementById("liveToast");
300+
301+
if (toastTrigger) {
302+
const toastBootstrap =
303+
bootstrap.Toast.getOrCreateInstance(toastLiveExample);
304+
toastTrigger.addEventListener("click", () => {
305+
toastBootstrap.show();
306+
});
307+
}
308+
</script>
296309
</Bootstrap>

0 commit comments

Comments
 (0)