update docs

pull/16607/head
Jack Goodall 3 weeks ago
parent 4c3c658bfa
commit c1f14c11e8

@ -40,6 +40,22 @@ In the case of readonly bindings like [dimension bindings](#Dimensions), the `ge
> [!NOTE]
> Function bindings are available in Svelte 5.9.0 and newer.
If you already have a tuple [get, set] or an object with `get` and/or `set` functions, you can use the spread syntax to bind them directly, instead of destructuring them beforehand.
This is especially handy when using helpers that return getter/setter pairs.
```svelte
<script>
function bindLowerCase(value) {
return [
() => value.toLowerCase(),
(v) => value = v.toLowerCase()
];
}
</script>
<input bind:value={...bindLowerCase(value)} />
```
## `<input bind:value>`
A `bind:value` directive on an `<input>` element binds the input's `value` property:

@ -93,7 +93,7 @@ Cannot `bind:group` to a snippet parameter
### bind_invalid_expression
```
Can only bind to an Identifier or MemberExpression or a `{get, set}` pair
Can only bind to an Identifier, a MemberExpression, a SpreadElement, or a `{get, set}` pair
```
### bind_invalid_name

Loading…
Cancel
Save