Skip to content

Commit 0da97e5

Browse files
committed
update docs for v-style
1 parent 49f96c4 commit 0da97e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

source/api/directives.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ When there is no argument, the bound value can either be a String or an Object.
8080
// or an Object:
8181
{
8282
color: 'red',
83-
fontWeight: 'bold'
83+
// both camelCase and dash-case works
84+
fontWeight: 'bold',
85+
'font-size': '2em'
8486
}
8587
```
8688

@@ -96,10 +98,11 @@ When there is an argument, it will be used as the CSS property to apply. Combine
9698
"></div>
9799
```
98100

99-
When the argument is prefixed with `$`, Vue.js will automatically apply prefixed version of the CSS rule too, so you don't have to manually write all the prefixes inline. In the following example Vue.js will apply `transform`, `webkitTransform`, `mozTransform` and `msTransform`:
101+
`v-style` is also smart to detect any required browser vendor prefixes, so you can just use the un-prefixed version:
100102

101103
``` html
102-
<div v-style="$transform: 'scale(' + scale + ')'"></div>
104+
<!-- will use -webkit-transform if needed, for example -->
105+
<div v-style="transform: 'scale(' + scale + ')'"></div>
103106
```
104107

105108
<p class="tip">It is recommended to use `v-style` instead of mustache bindings inside `style` attribute because Internet Explorer, regardless of version, will remove invalid inline styles when parsing the HTML.</p>

0 commit comments

Comments
 (0)