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

add warning or trim for event handler with extra space in template #3893

Closed
carrytao opened this issue Oct 10, 2016 · 4 comments
Closed

add warning or trim for event handler with extra space in template #3893

carrytao opened this issue Oct 10, 2016 · 4 comments

Comments

@carrytao
Copy link

Vue.js version

2.0.1

Reproduction Link

http://jsbin.com/faremewici/2/edit?html,js,console,output

Steps to reproduce

As you can see , @click=" onClickHandler " has extra space.
then click the link in output

What is Expected?

the console should warn that event handler doesn't exist or execute onClickHandler directly

What is actually happening?

the console output nothing

Even in webpack dev environment, Vue doesn't show any warning.
I expect Vue can give a warning in this situation or just trim it to execute onClickHandler method.

@posva
Copy link
Member

posva commented Oct 10, 2016

@hechentao I'm curious, how did you find yourself with spaces around that handle?

@carrytao
Copy link
Author

@posva Because I find the handler is not called, so I look into the code again and find spaces.
That's not important. Just need a warning for it in dev environment.

@posva
Copy link
Member

posva commented Oct 10, 2016

@hechentao But, how were the spaces introduces in the first place?

@carrytao
Copy link
Author

@posva Yes. I just made a mistake. I wrote code like@click="handler ". Adding a warning in this case can make Vue more friendly.

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

2 participants