Skip to content

Rule proposal: The "model" property should contain a "prop" property and an "event" property validly. #824

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

Closed
2 of 4 tasks
resessh opened this issue Feb 21, 2019 · 0 comments

Comments

@resessh
Copy link

resessh commented Feb 21, 2019

Please describe what the rule should do:

This rule requires prop and event properties in model property.

What category should the rule belong to?

  • Enforces code style
  • Warns about a potential error
  • Suggests an alternate way of doing something
  • Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

<script>
export default {
  model: {
    prop: 'someValue',
    // Needs 'event' property.
  },
};
</script>
<script>
export default {
  model: {
    props: 'someValue', // Needs 'prop' property.
    event: 'some-event',
  },
};
</script>

Additional context

  1. If settings is missing, v-model uses value as the prop and input as the event. But both settings should be required when use model property.
  2. Miss-typing with property name is easy to occur and founding the mistake is much harder.
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