From 39d3e78defff3598fd08674cb2147f05bd707086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=BC=8E?= Date: Thu, 27 Jun 2019 02:01:43 +0800 Subject: [PATCH] change "item" to "thing" The text in the button is "Remove first thing". --- site/content/tutorial/04-logic/05-keyed-each-blocks/text.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/tutorial/04-logic/05-keyed-each-blocks/text.md b/site/content/tutorial/04-logic/05-keyed-each-blocks/text.md index e8bac7d8df..3c204d1413 100644 --- a/site/content/tutorial/04-logic/05-keyed-each-blocks/text.md +++ b/site/content/tutorial/04-logic/05-keyed-each-blocks/text.md @@ -4,7 +4,7 @@ title: Keyed each blocks By default, when you modify the value of an `each` block, it will add and remove items at the *end* of the block, and update any values that have changed. That might not be what you want. -It's easier to show why than to explain. Click the 'Remove first item' button a few times, and notice that it's removing `` components from the end and updating the `value` for those that remain. Instead, we'd like to remove the first `` component and leave the rest unaffected. +It's easier to show why than to explain. Click the 'Remove first thing' button a few times, and notice that it's removing `` components from the end and updating the `value` for those that remain. Instead, we'd like to remove the first `` component and leave the rest unaffected. To do that, we specify a unique identifier for the `each` block: @@ -16,4 +16,4 @@ To do that, we specify a unique identifier for the `each` block: The `(thing.id)` tells Svelte how to figure out what changed. -> You can use any object as the key, as Svelte uses a `Map` internally — in other words you could do `(thing)` instead of `(thing.id)`. Using a string or number is generally safer, however, since it means identity persists without referential equality, for example when updating with fresh data from an API server. \ No newline at end of file +> You can use any object as the key, as Svelte uses a `Map` internally — in other words you could do `(thing)` instead of `(thing.id)`. Using a string or number is generally safer, however, since it means identity persists without referential equality, for example when updating with fresh data from an API server.