File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ declare interface VNodeData {
4242 staticClass ? : string ;
4343 class ?: any ;
4444 staticStyle ?: { [ key : string ] : any } ;
45- style ?: Array < Object > | Object ;
45+ style ?: string | Array < Object > | Object ;
4646 normalizedStyle ? : Object ;
4747 props ?: { [ key : string ] : any } ;
4848 attrs ?: { [ key : string ] : string } ;
Original file line number Diff line number Diff line change @@ -213,3 +213,28 @@ class Decorated extends Vue {
213213
214214const obj = Vue . observable ( { a : 1 } )
215215obj . 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 {
4848 staticClass ?: string ;
4949 class ?: any ;
5050 staticStyle ?: { [ key : string ] : any } ;
51- style ?: object [ ] | object ;
51+ style ?: string | object [ ] | object ;
5252 props ?: { [ key : string ] : any } ;
5353 attrs ?: { [ key : string ] : any } ;
5454 domProps ?: { [ key : string ] : any } ;
You can’t perform that action at this time.
0 commit comments