diff --git a/site/content/tutorial/03-logic/03-else-if-blocks/app-a/App.svelte b/site/content/tutorial/03-logic/03-else-if-blocks/app-a/App.svelte new file mode 100644 index 0000000000..efffa9af2b --- /dev/null +++ b/site/content/tutorial/03-logic/03-else-if-blocks/app-a/App.svelte @@ -0,0 +1,13 @@ + + +{#if x > 10} +
{x} is greater than 10
+{:else} + {#if 5 > x} +{x} is less than 5
+ {:else} +{x} is between 5 and 10
+ {/if} +{/if} \ No newline at end of file diff --git a/site/content/tutorial/03-logic/03-else-if-blocks/app-b/App.svelte b/site/content/tutorial/03-logic/03-else-if-blocks/app-b/App.svelte new file mode 100644 index 0000000000..9102618ff4 --- /dev/null +++ b/site/content/tutorial/03-logic/03-else-if-blocks/app-b/App.svelte @@ -0,0 +1,11 @@ + + +{#if x > 10} +{x} is greater than 10
+{:else if 5 > x} +{x} is less than 5
+{:else} +{x} is between 5 and 10
+{/if} \ No newline at end of file diff --git a/site/content/tutorial/03-logic/03-else-if-blocks/text.md b/site/content/tutorial/03-logic/03-else-if-blocks/text.md new file mode 100644 index 0000000000..16dd6b7f60 --- /dev/null +++ b/site/content/tutorial/03-logic/03-else-if-blocks/text.md @@ -0,0 +1,6 @@ +--- +title: Else-if blocks +--- + +Just like in JavaScript, we can 'chain' related conditional blocks together: +