Skip to content

Commit 239fe18

Browse files
devunteltigerchino
andauthored
docs: use svelte 5 syntax (#13030)
* docs: use svelte 5 syntax * apply change to other pages too --------- Co-authored-by: Chew Tee Ming <chew.tee.ming@nindatech.com>
1 parent 94c45b9 commit 239fe18

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

documentation/docs/20-core-concepts/10-routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ By exporting `POST`/`PUT`/`PATCH`/`DELETE`/`OPTIONS`/`HEAD` handlers, `+server.j
330330
<input type="number" bind:value={b}> =
331331
{total}
332332

333-
<button on:click={add}>Calculate</button>
333+
<button onclick={add}>Calculate</button>
334334
```
335335
336336
```js

documentation/docs/20-core-concepts/20-load.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ export async function load({ fetch, depends }) {
661661
</script>
662662
663663
<p>random number: {data.number}</p>
664-
<button on:click={rerunLoadFunction}>Update random number</button>
664+
<button onclick={rerunLoadFunction}>Update random number</button>
665665
```
666666

667667
### When do load functions rerun?

documentation/docs/20-core-concepts/30-form-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ We can also implement progressive enhancement ourselves, without `use:enhance`,
451451
}
452452
</script>
453453

454-
<form method="POST" on:submit|preventDefault={handleSubmit}>
454+
<form method="POST" onsubmit|preventDefault={handleSubmit}>
455455
<!-- content -->
456456
</form>
457457
```
@@ -484,7 +484,7 @@ Form actions are the preferred way to send data to the server, since they can be
484484
}
485485
</script>
486486

487-
<button on:click={rerun}>Rerun CI</button>
487+
<button onclick={rerun}>Rerun CI</button>
488488
```
489489
490490
```js

documentation/docs/30-advanced/67-shallow-routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ For this to work, you need to load the data that the `+page.svelte` expects. A c
5757
{#each data.thumbnails as thumbnail}
5858
<a
5959
href="/photos/{thumbnail.id}"
60-
on:click={async (e) => {
60+
onclick={async (e) => {
6161
if (innerWidth < 640 // bail if the screen is too small
6262
|| e.shiftKey // or the link is opened in a new window
6363
|| e.metaKey || e.ctrlKey // or a new tab (mac: metaKey, win/linux: ctrlKey)
@@ -86,7 +86,7 @@ For this to work, you need to load the data that the `+page.svelte` expects. A c
8686
{/each}
8787
8888
{#if $page.state.selected}
89-
<Modal on:close={() => history.back()}>
89+
<Modal onclose={() => history.back()}>
9090
<!-- pass page data to the +page.svelte component,
9191
just like SvelteKit would on navigation -->
9292
<PhotoPage data={$page.state.selected} />

0 commit comments

Comments
 (0)