From 41793b6694c36f3b693ad98894fdb66f6eb8eea1 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Wed, 27 Feb 2019 08:09:59 -0500 Subject: [PATCH] start adding else-if chapter --- .../03-logic/03-else-if-blocks/app-a/App.svelte | 13 +++++++++++++ .../03-logic/03-else-if-blocks/app-b/App.svelte | 11 +++++++++++ .../tutorial/03-logic/03-else-if-blocks/text.md | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100644 site/content/tutorial/03-logic/03-else-if-blocks/app-a/App.svelte create mode 100644 site/content/tutorial/03-logic/03-else-if-blocks/app-b/App.svelte create mode 100644 site/content/tutorial/03-logic/03-else-if-blocks/text.md 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: +