Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Jan 2, 2025
1 parent 7f88bb3 commit b5e82d6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/pages/frameworks/svelte.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,18 @@ If you'd rather not use the CDN for assets, you can create a build task that cop
One caveat is there's currently Svelte only supports `bind:value` directive in `<input>`, `<textarea>` and `<select>`, but you can still achieve two-way binding manually.

```jsx
//This doesn't work
//These do not work
<sl-input bind:value="name"></sl-input>

<sl-select bind:value="job">
<sl-option value="designer">Designer</sl-option>
<sl-option value="developer">Developer</sl-option>
</sl-select>

//This is a bit longer, but it works
//These are a bit longer, but work
<sl-input value={name} oninput={event => name = event.target.value}></sl-input>
<sl-select value={job} onsl-change={event => job = event.target.value}>

<sl-select value={job} onsl-input={event => job = event.target.value}>
<sl-option value="designer">Designer</sl-option>
<sl-option value="developer">Developer</sl-option>
</sl-select>
Expand Down

0 comments on commit b5e82d6

Please sign in to comment.