summaryrefslogtreecommitdiff
path: root/examples/framework-svelte/src/components/Counter.svelte
diff options
context:
space:
mode:
authorGravatar Erika <3019731+Princesseuh@users.noreply.github.com> 2022-08-04 14:16:51 -0400
committerGravatar GitHub <noreply@github.com> 2022-08-04 14:16:51 -0400
commitf591150512903014461e4fa1be3bc53bd261af2f (patch)
treedfdad8d11b3379cc47618398281ebca6e1be91bc /examples/framework-svelte/src/components/Counter.svelte
parent32580d4fdc6ba8bb9a7e39e0b2c001ab29b3b940 (diff)
downloadastro-f591150512903014461e4fa1be3bc53bd261af2f.tar.gz
astro-f591150512903014461e4fa1be3bc53bd261af2f.tar.zst
astro-f591150512903014461e4fa1be3bc53bd261af2f.zip
Audit examples templates (#3940)
* basics, framework-alpine, framework-solid, delete unused examples * framework-multiple * Remove non-standard file extensions, add missing .vscode folders * Remove robots.txt * Remove blog-multiple-authors * Rewrite components comments to be consistent * Update lockfile * Remove unnecessary usage of SCSS in subpath example * Fix props weirdness in portfolio example * Remove Lit from `framework-multiple` for now * Misc fixes * Update lockfile * I'm in lockfile hell, send help
Diffstat (limited to 'examples/framework-svelte/src/components/Counter.svelte')
-rw-r--r--examples/framework-svelte/src/components/Counter.svelte45
1 files changed, 23 insertions, 22 deletions
diff --git a/examples/framework-svelte/src/components/Counter.svelte b/examples/framework-svelte/src/components/Counter.svelte
index 2f4c07339..1353736aa 100644
--- a/examples/framework-svelte/src/components/Counter.svelte
+++ b/examples/framework-svelte/src/components/Counter.svelte
@@ -1,33 +1,34 @@
-<script>
- let count = 0;
+<script lang="ts">
+ let count = 0;
- function add() {
- count += 1;
- }
+ function add() {
+ count += 1;
+ }
- function subtract() {
- count -= 1;
- }
+ function subtract() {
+ count -= 1;
+ }
</script>
<div class="counter">
- <button on:click={subtract}>-</button>
- <pre>{ count }</pre>
- <button on:click={add}>+</button>
+ <button on:click={subtract}>-</button>
+ <pre>{count}</pre>
+ <button on:click={add}>+</button>
</div>
<div class="message">
- <slot />
+ <slot />
</div>
<style>
- .counter{
- display: grid;
- font-size: 2em;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- margin-top: 2em;
- place-items: center;
- }
- .message {
- text-align: center;
- }
+ .counter {
+ display: grid;
+ font-size: 2em;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ margin-top: 2em;
+ place-items: center;
+ }
+
+ .message {
+ text-align: center;
+ }
</style>