Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix: allow v-on without attribute values if it has verb modifiers (fixes #49) #50

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

Merged
michalsnik merged 2 commits into master from issue49
Jun 27, 2017

Conversation

Copy link
Member

@mysticatea mysticatea commented Jun 24, 2017

Fixes #49.

This PR fixes false positive of no-invalid-v-on rule.
If a v-on directive has verb modifiers (.stop or .prevent), now that rule allow the directive even if it does not have attribute values.

HerringtonDarkholme and xiguaxigua reacted with thumbs up emoji
Copy link
Member

@HerringtonDarkholme HerringtonDarkholme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your prompt fix!

Copy link
Member

@michalsnik michalsnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 only one suggestion

@@ -58,7 +62,7 @@ tester.run('no-invalid-v-on', rule, {
{
filename: 'test.vue',
code: '<template><div v-on:click></div></template>',
errors: ["'v-on' directives require that attribute value."]
errors: ["'v-on' directives require that attribute value or verb modifiers."]
Copy link
Member

@michalsnik michalsnik Jun 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though @ is a simple alias I think it would be good idea to add more valid test examples with v-on, like e.g.:

<template><div v-on:click.prevent></div></template>
<template><div v-on:click.native.stop></div></template>

Copy link
Member Author

@mysticatea mysticatea Jun 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added those!

michalsnik reacted with hooray emoji
@michalsnik michalsnik added this to the Official release milestone Jun 26, 2017
Copy link
Member

Released in v3.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
2 more reviewers

@HerringtonDarkholme HerringtonDarkholme HerringtonDarkholme approved these changes

@michalsnik michalsnik michalsnik approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: allow empty attribute value when event modifier is used

AltStyle によって変換されたページ (->オリジナル) /