You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/key-block-expression-2/main.svelte

17 lines
259 B

<script>
let obj = { key: 1, value: 3 };
export function mutate() {
obj.value = 5;
}
export function reassign() {
obj = { key: 1, value: 7 };
}
export function changeKey() {
obj.key = 3;
}
</script>
{#key obj.key}
<div>{obj.value}</div>
{/key}