pull/9609/head
baseballyama 3 years ago
parent fe4542f25b
commit 731b8cf006

@ -80,7 +80,7 @@ The `{@const ...}` tag defines a local constant.
</script>
{#each boxes as box}
{@const area = box.width * box.height}
{@const }
{box.width} * {box.height} = {area}
{/each}
```

@ -177,9 +177,11 @@ You cannot use TypeScript in your template's markup. For example, the following
let count = 10;
</script>
<h1>Count as string: {count as string}!</h1> <!-- ❌ Does not work -->
<h1>Count as string: {count as string}!</h1>
<!-- ❌ Does not work -->
{#if count > 4}
{@const countString: string = count} <!-- ❌ Does not work -->
{@const }
<!-- ❌ Does not work -->
{countString}
{/if}
```

@ -132,7 +132,7 @@ export interface Comment extends BaseNode {
export interface ConstTag extends BaseNode {
type: 'ConstTag';
declaration: VariableDeclaration & {
declarations: [VariableDeclarator & { id: Identifier, init: Expression } ]
declarations: [VariableDeclarator & { id: Identifier; init: Expression }];
};
}

@ -212,7 +212,7 @@
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="file-tabs" on:dblclick={add_new}>
{#each $files as file, index (file.name)}
{@const filename = get_full_filename(file)}
{@const }
<div
id={file.name}
class="button"
@ -236,7 +236,7 @@
App.svelte{#if show_modified && file.modified}*{/if}
</div>
{:else if filename === editing_name}
{@const editing_file = $files.find((file) => get_full_filename(file) === editing_name)}
{@const }
{#if editing_file}
<span class="input-sizer">

Loading…
Cancel
Save