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

Passing empty string into boolean type prop result in true #5959

Closed
jkzing opened this issue Jun 23, 2017 · 5 comments
Closed

Passing empty string into boolean type prop result in true #5959

jkzing opened this issue Jun 23, 2017 · 5 comments

Comments

@jkzing
Copy link
Member

jkzing commented Jun 23, 2017

Version

2.3.4

Reproduction link

https://jsfiddle.net/u2mo75oo/2/

Steps to reproduce

run repro

What is expected?

comp.name to be false or get warning.

What is actually happening?

comp.name is true.

@jkzing
Copy link
Member Author

jkzing commented Jun 23, 2017

Seems this is intended, found the code here: https://github.com/vuejs/vue/blob/dev/src/core/util/props.js#L27

Is there any background reason for this?

@gebilaoxiong
Copy link
Member

gebilaoxiong commented Jun 23, 2017

@Kingwl
Copy link
Member

Kingwl commented Jun 23, 2017

@gebilaoxiong i found wrong commit so i delete that 😂

@jkzing
Copy link
Member Author

jkzing commented Jun 23, 2017

Found it in docs as well...https://vuejs.org/v2/guide/migration.html#Built-In-Directives

Maybe we should make this more clear in component section?

@phanan
Copy link
Member

phanan commented Jun 23, 2017

You're welcome to submit a PR to Vue docs repo :)

@phanan phanan closed this as completed Jun 23, 2017
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

4 participants