diff options
author | 2024-11-15 19:37:28 +0800 | |
---|---|---|
committer | 2024-11-15 19:37:28 +0800 | |
commit | 671f50c7d3c02ab9d23d8d38ecb8934d080b6a40 (patch) | |
tree | 45af7931d284ee47857c9bc5c172f12eff779b2f /examples/ssr/src/components/AddToCart.svelte | |
parent | 4364bff27332e52f92da72392620a36110daee42 (diff) | |
parent | 55091174158a80f2e023571f6d10ffdbf17d274b (diff) | |
download | astro-671f50c7d3c02ab9d23d8d38ecb8934d080b6a40.tar.gz astro-671f50c7d3c02ab9d23d8d38ecb8934d080b6a40.tar.zst astro-671f50c7d3c02ab9d23d8d38ecb8934d080b6a40.zip |
Merge branch 'main' into next
Diffstat (limited to 'examples/ssr/src/components/AddToCart.svelte')
-rw-r--r-- | examples/ssr/src/components/AddToCart.svelte | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/ssr/src/components/AddToCart.svelte b/examples/ssr/src/components/AddToCart.svelte index 0f7a97a93..bae888b6b 100644 --- a/examples/ssr/src/components/AddToCart.svelte +++ b/examples/ssr/src/components/AddToCart.svelte @@ -1,7 +1,6 @@ <script> import { addToUserCart } from '../api'; - export let id = 0; - export let name = ''; + let { id, name } = $props() function notifyCartItem(id) { window.dispatchEvent(new CustomEvent('add-to-cart', { @@ -49,6 +48,6 @@ button:hover { text-transform: uppercase; } </style> -<button on:click={addToCart}> +<button click={addToCart}> <span class="pretext">Add to cart</span> </button> |