The script template style Structure
Understand the three-part structure of a Svelte component file.
Three Sections
A Svelte component file has three optional top-level blocks: <script>, the markup, and <style>.
The script Block
The script block holds component logic in regular JavaScript or TypeScript.
<script>
let name = "Ada";
</script>All lessons in this course
- The script template style Structure
- Reactive Variables with let
- Interpolation: {expression}
- Computed Values: $: reactive declarations