mirror of https://github.com/sveltejs/svelte
commit
422e658cdb
@ -0,0 +1,8 @@
|
||||
<script lang="ts">
|
||||
let focused = $state(false);
|
||||
</script>
|
||||
|
||||
<input bind:focused={focused} type="text" />
|
||||
<textarea bind:focused={focused}></textarea>
|
||||
<select bind:focused={focused}></select>
|
||||
<div bind:focused={focused}></div>
|
@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"code": "state_invalid_placement",
|
||||
"message": "`$derived(...)` can only be used as a variable declaration initializer or a class field",
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 26
|
||||
}
|
||||
}
|
||||
]
|
@ -0,0 +1,3 @@
|
||||
{#snippet test()}
|
||||
{@const der = $derived(0)}
|
||||
{/snippet}
|
Loading…
Reference in new issue