We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a variable that changes inside my component, like this:
<script lang="ts"> import { Focusable } from "..." let focused = false </script> <Focusable onFocus={() => { focused = true }} onUnfocus={() => { focused = false }} />
I want to expose focused such as in other components I can do:
focused
<script lang="ts"> let focused: boolean </script> <MyComponent bind:focused />
I don't know how this could be done - any idea?
would make my life easier
The text was updated successfully, but these errors were encountered:
https://github.com/sveltejs/svelte/search?q=readonly+binding&type=issues It this it? #7712
Or maybe you're new to Svelte and if you don't mind it being two way all your code is missing is an export.
export
<script lang="ts"> import { Focusable } from "..." -let focused = false +export let focused = false </script> <Focusable onFocus={() => { focused = true }} onUnfocus={() => { focused = false }} />
Sorry, something went wrong.
Seems like it is. I'm not new to Svelte but I absolutely want a one-way binding, hence the read-only requirement.
read-only
No branches or pull requests
Describe the problem
I have a variable that changes inside my component, like this:
I want to expose
focused
such as in other components I can do:Describe the proposed solution
I don't know how this could be done - any idea?
Alternatives considered
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: