mirror of https://github.com/sveltejs/svelte
The example uses a variable called `value` and a shorthand binding notation `<textarea bind:value>`. I think this example is simpler, and more consistent with other binding examples, if it doesn't rely on the reader knowing about the shorthand notation. For example, I was confused when I renamed the `value` variable to `text`, and it didn't work. ```js <script> let text = `Some words are *italic*, some are **bold**`; </script> <textarea bind:text></textarea> ``` This commit uses a variable named `text`, rather than `value`, and avoids the shorthand binding form.pull/3256/head
parent
2664260527
commit
18bbf90dfc
@ -1,12 +1,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import marked from 'marked';
|
import marked from 'marked';
|
||||||
let value = `Some words are *italic*, some are **bold**`;
|
let text = `Some words are *italic*, some are **bold**`;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
textarea { width: 100%; height: 200px; }
|
textarea { width: 100%; height: 200px; }
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<textarea bind:value></textarea>
|
<textarea bind:value={text}></textarea>
|
||||||
|
|
||||||
{@html marked(value)}
|
{@html marked(value)}
|
Loading…
Reference in new issue