Skip to content

Commit 50589c5

Browse files
committed
add a note about dynamic arguments in in-DOM templates
1 parent 577192b commit 50589c5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/v2/guide/syntax.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Dynamic arguments are expected to evaluate to a string, with the exception of `n
154154

155155
#### Dynamic Argument Expression Constraints
156156

157-
<p class="tip">Dynamic argument expressions have some syntax constraints because certain characters are invalid inside HTML attribute names, such as spaces and quotes.</p>
157+
<p class="tip">Dynamic argument expressions have some syntax constraints because certain characters are invalid inside HTML attribute names, such as spaces and quotes. You also need to avoid uppercase keys when using in-DOM templates.</p>
158158

159159
For example, the following is invalid:
160160

@@ -165,6 +165,13 @@ For example, the following is invalid:
165165

166166
The workaround is to either use expressions without spaces or quotes, or replace the complex expression with a computed property.
167167

168+
In addition, if you are using in-DOM templates (templates directly written in an HTML file), you have to be aware that browsers will coerce attribute names into lowercase:
169+
170+
``` html
171+
<!-- This will be converted to v-bind:[someattr] in in-DOM templates. -->
172+
<a v-bind:[someAttr]="value"> ... </a>
173+
```
174+
168175
### Modifiers
169176

170177
Modifiers are special postfixes denoted by a dot, which indicate that a directive should be bound in some special way. For example, the `.prevent` modifier tells the `v-on` directive to call `event.preventDefault()` on the triggered event:

0 commit comments

Comments
 (0)