This element tag is used to import a JavaScript file, it similar with <script type="module">
tag, but itβs only allowed to be used inside <custom-element>
tag.
The script tag then will be added in the <head>
tag, and will be executed once the Custom element is defined.
<custom-element name="my-element">
<import-script
from="https://cdn.jsdelivr.net/npm/[email protected]"></import-script>
<element-flow>
<trigger-event click="ShowConfettiBtn">
<script type="module/realm">
confetti({
particleCount: 100,
spread: 70,
origin: { y: 0.6 }
});
</script>
</trigger-event>
</element-flow>
<template>
<button ref="ShowConfettiBtn">Yay! π</button>
</template>
</custom-element>
<my-element></my-element>