@ -24,7 +24,7 @@ All three sections — script, styles and markup — are optional.
A `<script>` block contains JavaScript that runs when a component instance is created. Variables declared (or imported) at the top level are 'visible' from the component's markup. There are four additional rules:
A `<script>` block contains JavaScript that runs when a component instance is created. Variables declared (or imported) at the top level are 'visible' from the component's markup. There are four additional rules:
##### 1. `export` creates a component prop
#### 1. `export` creates a component prop
---
---
@ -87,7 +87,7 @@ You can use reserved words as prop names.
</script>
</script>
```
```
##### 2. Assignments are 'reactive'
#### 2. Assignments are 'reactive'
---
---
@ -109,7 +109,7 @@ Because Svelte's reactivity is based on assignments, using array methods like `.
</script>
</script>
```
```
##### 3. `$:` marks a statement as reactive
#### 3. `$:` marks a statement as reactive
---
---
@ -171,7 +171,7 @@ If a statement consists entirely of an assignment to an undeclared variable, Sve
</script>
</script>
```
```
##### 4. Prefix stores with `$` to access their values
#### 4. Prefix stores with `$` to access their values