-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
clarify directive documentation on using literals in the directive html attribute #122
Comments
Agreed. I once had a I will clarify this in the docs better. Thanks. |
|
moving this to the vuejs.org repo. |
Let's say I want to pass a string literal into a directive. I can do that one of two ways:
The literal string
test
will show up as thevalue
parameter to my directive'sbind
method. However, the need for single quotes inside the double quotes is a bit of an eyesore. So, we could do it this way:The literal string
test
is then available asthis.key
in my directive's methods. I like the way this looks better, but it has the potential to be confusing. The directive documentation needs to be good enough for me to know if it will interpret the keypath as a string or if a literal string expression is needed.Additionally, are there consequences (performance or otherwise) to abusing
this.key
for literal strings?I think these questions should be addressed in the directives in depth section of the documentation. The list of directives in the API reference does a good job of calling out "literal" directives, but they are not split up in the list at the top of the page.
The text was updated successfully, but these errors were encountered: