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

Shorthand v-bind #8741

Closed
onlycs opened this issue Jul 7, 2023 · 1 comment
Closed

Shorthand v-bind #8741

onlycs opened this issue Jul 7, 2023 · 1 comment
Labels
✨ feature request New feature or request

Comments

@onlycs
Copy link

onlycs commented Jul 7, 2023

What problem does this feature solve?

If I want to use v-bind on a component where the value I want to use is the same as the name of the property, it is redundant. It will provide a better developer experience to remove this redundancy.

What does the proposed API look like?

Current:

<!-- example.vue -->

<script>
export default {
  data() {
    return {
      somedata: true,
    };
  }
}
</script>

<template>
  <SomeComponent :somedata="somedata" /> <!-- notice we have to use the same word twice, which is redundant and unnecessary --> 
</template>

Proposed:

<!-- example.vue -->

<script>
export default {
  data() {
    return {
      somedata: true,
    };
  }
}
</script>

<template>
  <SomeComponent :somedata /> <!-- Automatically using the somedata value -->
</template>
@onlycs onlycs added the ✨ feature request New feature or request label Jul 7, 2023
@Shyam-Chen
Copy link
Contributor

Shyam-Chen commented Jul 7, 2023

Duplicate of #8178.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
✨ feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants