Skip to content
New issue

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

Bind value with boolean type are casted from undefined to false #38

Open
albertkur opened this issue Jan 8, 2023 · 0 comments
Open

Comments

@albertkur
Copy link
Contributor

albertkur commented Jan 8, 2023

Use case: when we have a boolean property to bind in a component. The expectation is that if we don't bind the value the getBound() method in the view model should return undefined. but vue casts boolean values from undefined to false.

vuejs/vue#4792

Vue does this to support HTML attributes. for example if we don't set the disabled attribute in an input element that means disabled = false. this behavior is documented in vue 3 https://vuejs.org/guide/components/props.html#boolean-casting

but in the case of n-app we create our own components. so the expectation is that when we don't provide a value for boolean attributes getBound() should return undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant