@@ -39,6 +39,9 @@ h('div', { id: 'foo' })
39
39
// Vue automatically picks the right way to assign it
40
40
h (' div' , { class: ' bar' , innerHTML: ' hello' })
41
41
42
+ // props modifiers such as .prop and .attr can be added via shorthands
43
+ h (' div' , { .name : ' some-name' , ^ width: ' 100' })
44
+
42
45
// class and style have the same object / array
43
46
// value support that they have in templates
44
47
h (' div' , { class: [foo, { bar }], style: { color: ' red' } })
@@ -112,11 +115,7 @@ import { h } from 'vue'
112
115
export default {
113
116
setup () {
114
117
// use an array to return multiple root nodes
115
- return () => [
116
- h (' div' ),
117
- h (' div' ),
118
- h (' div' )
119
- ]
118
+ return () => [h (' div' ), h (' div' ), h (' div' )]
120
119
}
121
120
}
122
121
```
@@ -163,11 +162,7 @@ import { h } from 'vue'
163
162
export default {
164
163
render () {
165
164
// use an array to return multiple root nodes
166
- return [
167
- h (' div' ),
168
- h (' div' ),
169
- h (' div' )
170
- ]
165
+ return [h (' div' ), h (' div' ), h (' div' )]
171
166
}
172
167
}
173
168
```
@@ -563,8 +558,8 @@ Passing slots as functions allows them to be invoked lazily by the child compone
563
558
import { h , KeepAlive , Teleport , Transition , TransitionGroup } from ' vue'
564
559
565
560
export default {
566
- setup () {
567
- return () => h (Transition, { mode: ' out-in' }, /* ... */ )
561
+ setup () {
562
+ return () => h (Transition, { mode: ' out-in' } /* ... */ )
568
563
}
569
564
}
570
565
```
@@ -576,8 +571,8 @@ export default {
576
571
import { h , KeepAlive , Teleport , Transition , TransitionGroup } from ' vue'
577
572
578
573
export default {
579
- render () {
580
- return h (Transition, { mode: ' out-in' }, /* ... */ )
574
+ render () {
575
+ return h (Transition, { mode: ' out-in' } /* ... */ )
581
576
}
582
577
}
583
578
```
@@ -614,7 +609,8 @@ export default {
614
609
render () {
615
610
return h (SomeComponent, {
616
611
modelValue: this .modelValue ,
617
- ' onUpdate:modelValue ' : (value ) => this .$emit (' update:modelValue' , value)
612
+ ' onUpdate:modelValue ' : (value ) =>
613
+ this .$emit (' update:modelValue' , value)
618
614
})
619
615
}
620
616
}
@@ -631,8 +627,12 @@ import { h, withDirectives } from 'vue'
631
627
632
628
// a custom directive
633
629
const pin = {
634
- mounted () { /* ... */ },
635
- updated () { /* ... */ }
630
+ mounted () {
631
+ /* ... */
632
+ },
633
+ updated () {
634
+ /* ... */
635
+ }
636
636
}
637
637
638
638
// <div v-pin:top.animate="200"></div>
0 commit comments