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

dynamic attribute names are not recognized as described in the Vue.js docs #9548

Closed
rustysys-dev opened this issue Feb 21, 2019 · 3 comments
Closed

Comments

@rustysys-dev
Copy link

Version

2.6.6

Reproduction link

https://jsfiddle.net/ferpzqvx/2/

Steps to reproduce

  • Create a Vue app with data property attrName with a value of href
  • Create an <a> HTML tag with the following attribute bind v-bind:[attrName]=some-link

What is expected?

I was expecting the DOM to produce output similar to the following, as per expectations set here

<a href="www.google.com">Website</a>

OR

I could expect that the documents should be fixed so as to not show a camel case example.

What is actually happening?

The above will fail with the console saying that attrname does not exist.

attrname in lowecase being nowhere in the code written.

@posva
Copy link
Member

posva commented Feb 21, 2019

Damn, this should be indeed updated in docs.we cannot use camelCase variables in html templates, we should reflect that via a note. It will only works on Vue files and string templates. Could you check if the issue exists on vuejs.org repo and if it doesn't, open a new one please? If you feel like creating a pull request instead that would also be good

@posva posva closed this as completed Feb 21, 2019
@rustysys-dev
Copy link
Author

rustysys-dev commented Feb 21, 2019

@posva thank you, and yes, I will check vuejs.org repo and open a new issue there if the issue is not fixed there.

EDIT: Ended up created the pull request, it is waiting to be merged! Thanks again!

@yyx990803
Copy link
Member

Added a note in vuejs/v2.vuejs.org@50589c5

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

3 participants