File tree 3 files changed +27
-2
lines changed
3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ declare interface VNodeData {
42
42
staticClass ? : string ;
43
43
class ?: any ;
44
44
staticStyle ?: { [ key : string ] : any } ;
45
- style ?: Array < Object > | Object ;
45
+ style ?: string | Array < Object > | Object ;
46
46
normalizedStyle ? : Object ;
47
47
props ?: { [ key : string ] : any } ;
48
48
attrs ?: { [ key : string ] : string } ;
Original file line number Diff line number Diff line change @@ -213,3 +213,28 @@ class Decorated extends Vue {
213
213
214
214
const obj = Vue . observable ( { a : 1 } )
215
215
obj . a ++
216
+
217
+ // VNodeData style tests.
218
+ const ComponentWithStyleInVNodeData = Vue . extend ( {
219
+ render ( h ) {
220
+ const elementWithStyleAsString = h ( 'div' , {
221
+ style : 'background-color: red;'
222
+ } ) ;
223
+
224
+ const elementWithStyleAsObject = h ( 'div' , {
225
+ style : { backgroundColor : 'green' }
226
+ } ) ;
227
+
228
+ const elementWithStyleAsArrayOfObjects = h ( 'div' , {
229
+ style : [
230
+ { backgroundColor : 'blue' }
231
+ ]
232
+ } ) ;
233
+
234
+ return h ( 'div' , undefined , [
235
+ elementWithStyleAsString ,
236
+ elementWithStyleAsObject ,
237
+ elementWithStyleAsArrayOfObjects
238
+ ] ) ;
239
+ }
240
+ } ) ;
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export interface VNodeData {
48
48
staticClass ?: string ;
49
49
class ?: any ;
50
50
staticStyle ?: { [ key : string ] : any } ;
51
- style ?: object [ ] | object ;
51
+ style ?: string | object [ ] | object ;
52
52
props ?: { [ key : string ] : any } ;
53
53
attrs ?: { [ key : string ] : any } ;
54
54
domProps ?: { [ key : string ] : any } ;
You can’t perform that action at this time.
0 commit comments