summaryrefslogtreecommitdiff
path: root/examples/ssr/src/components/AddToCart.svelte
diff options
context:
space:
mode:
authorGravatar Jacob Jenkins <jacob_jenkins@live.com> 2024-11-14 15:31:51 +0000
committerGravatar GitHub <noreply@github.com> 2024-11-14 23:31:51 +0800
commit9fc2ab8cc848739a21bfa3f754e9bec4926dc034 (patch)
treea184ada6711296569a064c01defd2fa6a74f63c5 /examples/ssr/src/components/AddToCart.svelte
parentbdc0890061533466da19660ff83a331a3136f6c4 (diff)
downloadastro-9fc2ab8cc848739a21bfa3f754e9bec4926dc034.tar.gz
astro-9fc2ab8cc848739a21bfa3f754e9bec4926dc034.tar.zst
astro-9fc2ab8cc848739a21bfa3f754e9bec4926dc034.zip
Update to svelte 5 (#12364)
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
Diffstat (limited to 'examples/ssr/src/components/AddToCart.svelte')
-rw-r--r--examples/ssr/src/components/AddToCart.svelte5
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>